/* static/style.css */

/* --- 0. 字体引入 --- */
@import url("https://fontsapi.zeoseven.com/13/main/result.css");
@import url("https://fontsapi.zeoseven.com/415/main/result.css");
@import url("https://fontsapi.zeoseven.com/159/main/result.css");

/* --- 1. 主题变量 --- */

/* 浅色模式：月面看宇宙
   站在月球表面，仰望深邃的宇宙
   背景是月壤的灰白色，文字是宇宙的深蓝黑
*/
:root,
[data-theme="light"] {
    font-size: 18px;
    --bg-body: #e8e8ec; /* 月壤色，灰白如月球表面 */
    --bg-card: #f0f0f4; /* 略亮的月面 */
    --bg-elevated: #f8f8fa; /* 最亮的高光区域 */
    --text-main: #1a1e2e; /* 宇宙的深蓝黑 */
    --text-muted: #5a6078; /* 疏远的星尘灰 */
    --text-dim: #8a90a8; /* 更淡的文字 */
    --border-color: #c8c8d0; /* 月面裂纹般的边框 */
    --border-subtle: #d8d8e0; /* 更淡的边框 */

    /* 强调色 - 宇宙的深蓝，如仰望星空 */
    --accent: #3a5070; /* 深邃的宇宙蓝 */
    --accent-hover: #4a6080; /* hover 时略亮 */
    --accent-subtle: rgba(58, 80, 112, 0.1); /* 淡淡的强调背景 */

    /* 月光色 - 用于特殊点缀 */
    --moonlight: #d4d8e0; /* 冷冽的月光 */
    --moonlight-bright: #e0e4e8; /* 更亮的月光 */

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(26, 30, 46, 0.05);
    --shadow-md: 0 4px 12px rgba(26, 30, 46, 0.08);
    --shadow-lg: 0 8px 24px rgba(26, 30, 46, 0.12);

    /* 状态色 */
    --color-success: #4a6a5a; /* 沉稳的绿 */
    --color-warning: #7a6a4a; /* 沉稳的黄 */
    --color-error: #6a4a5a; /* 沉稳的红 */
    --color-info: #4a5a7a; /* 沉稳的蓝 */

    /* Stack 类型标签色 - 浅色模式下使用柔和的彩色 */
    --stack-book-bg: #d8d4cc; /* 书籍：米纸色 */
    --stack-book-fg: #4a4030; /* 深棕文字 */
    --stack-movie-bg: #ccd8e0; /* 电影：天蓝色 */
    --stack-movie-fg: #304050; /* 深蓝文字 */
    --stack-game-bg: #d8cce0; /* 游戏：淡紫色 */
    --stack-game-fg: #403050; /* 深紫文字 */
    --stack-music-bg: #cce0d8; /* 音乐：薄荷色 */
    --stack-music-fg: #305040; /* 深绿文字 */
    --stack-anime-bg: #e0ccd8; /* 动漫：樱色 */
    --stack-anime-fg: #503040; /* 深玫红文字 */
    --stack-drama-bg: #e0d8cc; /* 剧集：奶茶色 */
    --stack-drama-fg: #504030; /* 深褐文字 */

    /* 布局 */
    --container-width: 960px;
    --header-height: 80px;

    /* 风格：锐利，无圆角 */
    --radius: 0px;

    /* 字体 */
    --font-sans: "WenYuan Sans SC VF", sans-serif;
    --font-serif: "WenYuan Serif SC VF", serif;
    --font-mono: "Sarasa Mono SC", monospace;

    /* 过渡 */
    --transition-theme:
        background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    --transition-theme-active: none;
}

/* 深色模式：宇宙看月面
   飘浮在宇宙中，凝视月球
   背景是宇宙的深蓝黑，文字是月面的灰白
*/
[data-theme="dark"] {
    --bg-body: #080c14; /* 宇宙的深蓝黑 */
    --bg-card: #0c1018; /* 略深的星云 */
    --bg-elevated: #101420; /* 最深的背景 */
    --text-main: #e4e8f0; /* 月面的灰白 */
    --text-muted: #8890a8; /* 星尘的银灰 */
    --text-dim: #606880; /* 暗淡的星云 */
    --border-color: #1e2838; /* 宇宙边缘 */
    --border-subtle: #181e28; /* 更淡的边框 */

    /* 强调色 - 月光的银白 */
    --accent: #8a9cb0; /* 月光般的银蓝 */
    --accent-hover: #9aacbc; /* hover 时更亮 */
    --accent-subtle: rgba(138, 156, 176, 0.15); /* 淡淡的月光 */

    /* 月光色 */
    --moonlight: #c0c8d0; /* 柔和的月光 */
    --moonlight-bright: #d8dce0; /* 更亮的月光 */

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

    /* 状态色 */
    --color-success: #5a8a6a; /* 清冷的绿 */
    --color-warning: #8a7a5a; /* 清冷的黄 */
    --color-error: #8a5a6a; /* 清冷的红 */
    --color-info: #5a6a8a; /* 清冷的蓝 */

    /* Stack 类型标签色 - 深色模式下使用清冷暗调 */
    --stack-book-bg: #2a2820; /* 书籍：暗棕 */
    --stack-book-fg: #b0a090; /* 浅棕文字 */
    --stack-movie-bg: #202830; /* 电影：暗蓝 */
    --stack-movie-fg: #90a0b0; /* 浅蓝文字 */
    --stack-game-bg: #282030; /* 游戏：暗紫 */
    --stack-game-fg: #a090b0; /* 浅紫文字 */
    --stack-music-bg: #203028; /* 音乐：暗绿 */
    --stack-music-fg: #90b0a0; /* 浅绿文字 */
    --stack-anime-bg: #302028; /* 动漫：暗玫红 */
    --stack-anime-fg: #b090a0; /* 浅玫红文字 */
    --stack-drama-bg: #302820; /* 剧集：暗褐 */
    --stack-drama-fg: #b0a090; /* 浅褐文字 */
}

/* 系统主题：跟随系统偏好 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-body: #080c14;
        --bg-card: #0c1018;
        --bg-elevated: #101420;
        --text-main: #e4e8f0;
        --text-muted: #8890a8;
        --text-dim: #606880;
        --border-color: #1e2838;
        --border-subtle: #181e28;
        --accent: #8a9cb0;
        --accent-hover: #9aacbc;
        --accent-subtle: rgba(138, 156, 176, 0.15);
        --moonlight: #c0c8d0;
        --moonlight-bright: #d8dce0;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
        --color-success: #5a8a6a;
        --color-warning: #8a7a5a;
        --color-error: #8a5a6a;
        --color-info: #5a6a8a;

        /* Stack 类型标签色 - 深色模式下使用清冷暗调 */
        --stack-book-bg: #2a2820;
        --stack-book-fg: #b0a090;
        --stack-movie-bg: #202830;
        --stack-movie-fg: #90a0b0;
        --stack-game-bg: #282030;
        --stack-game-fg: #a090b0;
        --stack-music-bg: #203028;
        --stack-music-fg: #90b0a0;
        --stack-anime-bg: #302028;
        --stack-anime-fg: #b090a0;
        --stack-drama-bg: #302820;
        --stack-drama-fg: #b0a090;
    }
}

/* --- 通用 Tag 样式 --- */
.tag-list {
    display: inline-flex;
    flex-wrap: wrap;
}

.tag-item {
    font-size: inherit;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0;
}

.tag-item + .tag-item {
    margin-left: 4px;
}

.admin-tag {
    font-family: var(--font-sans);
    letter-spacing: 0;
}

/* --- 3. 基础样式 --- */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-serif);
    font-weight: normal;
    line-height: 1.7;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    transition: var(--transition-theme-active);
}

html.modal-open,
body.modal-open {
    overflow: hidden;
}

/* --- 4. 布局组件 --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 18px 100px;
}

/* 导航栏 */
.nav-header {
    min-height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 60px;
    padding: 16px 0;
    transition: var(--transition-theme-active);
}

.site-logo-link {
    text-decoration: none;
}

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

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

.site-logo {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
    transition: color 0.2s;
}

/* Logo 容器，包含标题和主题切换 */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    min-width: 0;
}

.site-mark {
    width: 22px;
    height: 22px;
    display: block;
    flex: 0 0 22px;
}

span.site-mark {
    background-color: var(--text-main);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    transition: background-color 0.2s;
}

.nav-links {
    display: flex;
    gap: 24px;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.nav-item {
    font-size: 0.85rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
}

.nav-item.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
}

.theme-cycle-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: color 0.18s ease;
}

.theme-cycle-btn:hover {
    color: var(--text-main);
}

.theme-cycle-btn:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

/* 页脚 */
.site-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    margin-top: 80px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    transition: var(--transition-theme-active);
    font-family: var(--font-mono);
}

.site-footer-theme,
.site-footer-account,
.site-footer-user,
.footer-tool,
.footer-link,
.site-footer-copy,
.site-footer-beian {
    font-family: var(--font-mono);
    font-size: 0.76rem;
}

.site-footer-center {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    justify-self: center;
}

.site-footer-theme,
.site-footer-account {
    display: flex;
    align-items: center;
    min-width: 0;
}

.site-footer-theme {
    justify-content: flex-start;
}

.site-footer-account {
    justify-content: flex-end;
}

.site-footer-user {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-muted);
    min-width: 0;
}

.footer-tool {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.footer-tool {
    color: var(--text-muted);
}

.footer-tool-icon {
    position: relative;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    display: inline-block;
}

.footer-tool-icon-theme::before,
.footer-tool-icon-theme::after,
.footer-tool-icon-user::before,
.footer-tool-icon-user::after {
    content: "";
    position: absolute;
    display: block;
}

.footer-tool-icon-theme::before {
    inset: 1px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
}

.footer-tool-icon-theme::after {
    top: 2px;
    right: 2px;
    bottom: 2px;
    width: 4px;
    background: var(--text-muted);
    border-radius: 0 999px 999px 0;
}

.footer-tool-icon-user::before {
    top: 1px;
    left: 3px;
    width: 6px;
    height: 6px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
}

.footer-tool-icon-user::after {
    left: 1px;
    right: 1px;
    bottom: 1px;
    height: 4px;
    border: 1px solid var(--border-color);
    border-top: 0;
    border-radius: 0 0 999px 999px;
}

.footer-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible,
.theme-cycle-btn:hover,
.theme-cycle-btn:focus-visible {
    color: var(--text-main);
}

.site-footer-copy {
    text-align: center;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer-beian {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    text-decoration: none;
    white-space: nowrap;
}

.site-footer-beian:hover,
.site-footer-beian:focus-visible {
    color: var(--text-main);
}

.auth-dialog {
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0;
    width: min(480px, calc(100vw - 32px));
}

.auth-dialog::backdrop {
    background: rgba(0, 0, 0, 0.42);
}

.auth-dialog-form {
    padding: 18px;
}

.auth-dialog-title {
    margin-bottom: 14px;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--text-main);
}

.auth-dialog-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.auth-dialog-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-dialog-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.96rem;
}

.auth-dialog-input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-dialog-error {
    margin-top: 2px;
    color: var(--color-error);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.auth-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.auth-dialog-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
}

.auth-dialog-btn:hover,
.auth-dialog-btn:focus-visible {
    color: var(--text-main);
}

.auth-dialog-primary {
    color: var(--text-main);
}

/* --- 5. 通用排版 --- */
h1,
h2,
h3 {
    font-family: var(--font-sans);
    color: var(--text-main);
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}

h1 {
    font-size: 2.6rem;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

h3 {
    font-size: 1.35rem;
}

p {
    margin-bottom: 1.6em;
    color: var(--text-muted);
}

a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 3px;
    transition: all 0.2s;
}

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

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 60px;
    font-style: italic;
}

/* --- 6. 首页文章列表 --- */
.post-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none !important;
    transition: var(--transition-theme-active);
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-thumb {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 0;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    transition: var(--transition-theme-active);
}

@media (max-width: 600px) {
    .post-thumb {
        display: none;
    }
}

.post-title {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    margin: 0 0 8px 0;
    color: var(--text-main);
    border-bottom: none;
    padding-bottom: 0;
    transition: color 0.2s;
    line-height: 1.3;
}

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

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.post-modified {
    color: var(--text-dim);
}

.post-desc {
    margin-top: 12px;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- 7. 关于页 --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
}

.avatar {
    width: 120px;
    height: 120px;
    padding: 4px;
    object-fit: cover;
}

.about-hero {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 20px;
    margin: 24px auto 72px;
}

.about-hero-mark {
    width: 96px;
    height: 96px;
    padding: 0;
    object-fit: contain;
}

.about-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.about-hero-copy h1 {
    margin-bottom: 0;
}

.about-hero-copy p {
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.about-content {
    max-width: 760px;
    margin: 0 auto;
}

.social-links {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 20px;
}

.about-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 1.6em;
}

.about-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 1.6em;
}

.about-contact-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: inherit;
    text-decoration: none;
    transition:
        color 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease;
}

.about-contact-item:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.about-contact-label {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color 0.18s ease;
}

.about-contact-value {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text-main);
    word-break: break-word;
    transition: color 0.18s ease;
}

.about-contact-item:hover .about-contact-label,
.about-contact-item:hover .about-contact-value {
    color: inherit;
}

.about-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 0 1.6em;
    border-top: 1px solid var(--border-color);
}

.about-link-item {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    color: inherit;
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        color 0.18s ease;
}

.about-link-item:hover {
    border-color: var(--accent);
    color: var(--text-main);
}

.about-link-meta {
    min-width: 0;
}

.about-link-label {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.02rem;
    color: var(--text-main);
}

.about-link-value {
    display: block;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.about-link-desc {
    font-size: 0.96rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* --- 8. 画廊页 --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.gallery-item {
    margin: 0;
}

.gallery-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    background: var(--border-color);
    filter: grayscale(30%) brightness(0.95);
    transition:
        filter 0.3s,
        var(--transition-theme-active);
}

.gallery-item:hover .gallery-img {
    filter: grayscale(0%) brightness(1);
}

.caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
}

/* --- 9. 文章详情页 --- */
.article-header {
    text-align: center;
    margin: 40px 0 60px;
}

.article-title {
    font-size: 4rem;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-date {
    text-transform: uppercase;
}

.article-modified {
    color: var(--text-dim);
}

.article-content {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text-main);
}

.article-content > *:first-child {
    margin-top: 0;
}

.article-content p,
.article-content li {
    color: var(--text-muted);
}

.article-content p {
    margin: 0 0 1.4em;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: var(--text-main);
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.article-content h4,
.article-content h5,
.article-content h6 {
    font-family: var(--font-sans);
    line-height: 1.35;
    margin: 1.8em 0 0.7em;
}

.article-content h4 {
    font-size: 1.2rem;
}

.article-content h5 {
    font-size: 1.1rem;
}

.article-content h6 {
    font-size: 1.05rem;
}

.article-content ul,
.article-content ol {
    margin: 0 0 1.5em 1.4em;
    padding-left: 1.2em;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content ul ul,
.article-content ol ul {
    list-style: circle;
}

.article-content ol ol,
.article-content ul ol {
    list-style: lower-alpha;
}

.article-content li {
    margin: 0.2em 0;
    padding-left: 0.2em;
}

.article-content li > p {
    margin: 0.2em 0;
}

.article-content li::marker {
    color: var(--accent);
    font-family: var(--font-mono);
}

.article-content input[type="checkbox"] {
    margin-right: 0.5em;
    accent-color: var(--accent);
}

.article-content blockquote {
    margin: 1.8em 0;
    padding: 0.2em 0 0.2em 1.2em;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

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

.article-content .callout {
    --callout-accent: var(--accent);
    margin: 1.8em 0;
    padding: 1rem 1.2rem 1.05rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--callout-accent);
    background:
        linear-gradient(180deg, var(--bg-elevated), transparent 160%),
        var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.article-content .callout-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.article-content .callout-label {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border: 1px solid currentColor;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--callout-accent);
    background: var(--accent-subtle);
}

.article-content .callout-title-text {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.article-content .callout-body > :first-child {
    margin-top: 0;
}

.article-content .callout-body > :last-child {
    margin-bottom: 0;
}

.article-content .callout .callout {
    margin: 1.2em 0;
}

.article-content .callout-note,
.article-content .callout-more,
.article-content .callout-compare,
.article-content .callout-example {
    --callout-accent: var(--accent);
}

.article-content .callout-star {
    --callout-accent: var(--color-success);
}

.article-content .callout-question {
    --callout-accent: var(--color-info);
}

.article-content .callout-caution {
    --callout-accent: var(--color-warning);
}

.article-content .callout-warning,
.article-content .callout-danger,
.article-content .callout-failure,
.article-content .callout-bug {
    --callout-accent: var(--color-error);
}

.article-content .callout-chirp {
    --callout-accent: var(--text-dim);
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--text-main);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 0.08em 0.28em;
}

.article-content pre {
    background: var(--bg-elevated);
    color: var(--text-main);
    padding: 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    border-radius: 0;
    border: 1px solid var(--border-color);
    transition: var(--transition-theme-active);
}

.article-content pre code {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.article-content table {
    width: 100%;
    margin: 1.8em 0;
    border-collapse: collapse;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.article-content th,
.article-content td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    vertical-align: top;
}

.article-content th {
    color: var(--text-main);
    background: var(--bg-elevated);
    font-weight: 600;
}

.article-content td {
    color: var(--text-muted);
}

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

.article-content .math {
    font-family: var(--font-mono);
}

.article-content .math-display {
    display: block;
    margin: 1.8em 0;
    padding: 1em;
    overflow-x: auto;
    color: var(--text-main);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.article-content mjx-container {
    color: var(--text-main);
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

.article-content mjx-container[jax="CHTML"][display="true"] {
    margin: 1.8em 0;
    padding: 1em 0;
}

.article-content img {
    max-width: 100%;
    width: 60%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.about-note {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.about-note p,
.about-note li {
    font-size: 0.98rem;
}

/* --- 10. 文章导航 --- */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    transition: var(--transition-theme-active);
}

.article-nav a {
    text-decoration: none;
    color: var(--text-muted);
    max-width: 45%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.article-nav .nav-prev {
    align-items: flex-start;
    text-align: left;
}

.article-nav .nav-next {
    align-items: flex-end;
    text-align: right;
}

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

.nav-label {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    line-height: 1;
}

.nav-title {
    font-size: 0.96rem;
    font-weight: 500;
}

/* Figure & Caption */
.post-figure {
    margin: 30px 0;
    text-align: center;
}

.post-figure img {
    width: 60%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: var(--shadow-md);
}

@media (max-width: 720px) {
    .article-content img,
    .post-figure img {
        width: 100%;
    }
}

.post-figure figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* --- 11. 交互区域 --- */
.interaction-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.comments-wrapper {
    display: flex;
    flex-direction: column;
}

.btn-like,
.btn-comment,
.btn-submit {
    padding: 0;
    background: transparent;
    border: 0;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--text-muted);
    transition:
        color 0.18s ease,
        opacity 0.18s ease;
    border-radius: 0;
}

.btn-like:hover,
.btn-comment:hover,
.btn-submit:hover {
    color: var(--accent);
}

.btn-like.liked,
.btn-comment.active {
    color: var(--accent);
}

.interaction-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.interaction-actions {
    display: inline-flex;
    align-items: baseline;
    gap: 18px;
    flex-wrap: wrap;
}

.comments-wrapper h3 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0.82;
}

.interaction-icon {
    width: 0.95rem;
    height: 0.95rem;
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    transform: translateY(3px);
}

.icon-heart {
    -webkit-mask-image: url("/assets/ui/heart.svg");
    mask-image: url("/assets/ui/heart.svg");
}

.btn-like.liked .icon-heart {
    -webkit-mask-image: url("/assets/ui/heart-fill.svg");
    mask-image: url("/assets/ui/heart-fill.svg");
}

.chirp-like-pill.liked .icon-heart {
    -webkit-mask-image: url("/assets/ui/heart-fill.svg");
    mask-image: url("/assets/ui/heart-fill.svg");
}

.icon-message {
    -webkit-mask-image: url("/assets/ui/message.svg");
    mask-image: url("/assets/ui/message.svg");
}

.btn-comment.active .icon-message {
    -webkit-mask-image: url("/assets/ui/message-fill.svg");
    mask-image: url("/assets/ui/message-fill.svg");
}

.chirp-comment-pill.active .icon-message {
    -webkit-mask-image: url("/assets/ui/message-fill.svg");
    mask-image: url("/assets/ui/message-fill.svg");
}

/* 评论区 */
.comment-form {
    padding-top: 10px;
}

.comment-form textarea {
    width: 100%;
    min-height: 96px;
    height: 96px;
    padding: 10px 0 12px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    font-family: var(--font-serif);
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text-main);
    box-sizing: border-box;
    transition:
        border-color 0.18s ease,
        color 0.18s ease;
    resize: vertical;
}

.comment-form textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.btn-submit {
    color: var(--text-main);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

.comment-identity-dialog {
    width: min(420px, calc(100vw - 32px));
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0;
}

.comment-identity-dialog::backdrop {
    background: rgba(0, 0, 0, 0.46);
}

.comment-identity-card {
    display: grid;
    gap: 16px;
    padding: 18px;
}

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

.comment-identity-header h3 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
}

.comment-identity-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.comment-identity-copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.comment-identity-field {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.comment-identity-field input {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    padding: 8px 0 10px;
    font: inherit;
    font-family: var(--font-serif);
    font-size: 1rem;
    outline: none;
}

.comment-identity-field input:focus {
    border-bottom-color: var(--accent);
}

.comment-identity-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.comment-identity-login,
.comment-identity-guest {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.comment-identity-guest {
    color: var(--text-main);
}

.comment-identity-login:hover,
.comment-identity-guest:hover,
.comment-identity-close:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin-top: 34px;
    border-top: 1px solid var(--border-subtle);
}

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

.comment-item-new {
    animation: fadeIn 0.5s;
}

.comment-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 22px 0 8px;
    opacity: 0.62;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.comment-avatar {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-card);
}

.comment-avatar img,
.chirp-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.comment-author-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.comment-userid {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    line-height: 1.2;
    color: var(--text-main);
}

.comment-date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text-muted);
    opacity: 0.72;
}

.comment-body {
    color: var(--text-muted);
    font-family: var(--font-serif);
    font-size: 0.96rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

@media (max-width: 720px) {
    .interaction-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .interaction-actions {
        width: 100%;
        justify-content: space-between;
    }

    .chirp-interactions {
        gap: 16px;
    }

    .chirp-interaction-label {
        display: none;
    }
}

@media (max-width: 520px) {
    .chirp-time-part {
        display: none;
    }
}

@media (max-width: 400px) {
    .chirp-meta-tags-inline,
    .chirp-meta-tags-block {
        display: none;
    }
}

/* 年份标题 */
.gallery-year-header {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    margin: 60px 0 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--text-main);
    display: inline-block;
}

/* 照片卡片容器 */
.gallery-section {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.gallery-card {
    display: block;
    margin-bottom: 20px;
    animation: fadeIn 0.6s ease;
}

.gallery-card-img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
    margin-bottom: 20px;
}

.gallery-card-content {
    max-width: 100%;
}

.gallery-card-title {
    font-family: var(--font-sans);
    font-size: 1.4rem;
    margin: 0 0 12px 0;
    color: var(--text-main);
}

.gallery-card-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 8px;
}

.gallery-photographer {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
    margin-top: 10px;
    display: block;
}

/* --- Stacks 页面 --- */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.stacks-masonry-container {
    position: relative;
    width: 100%;
}

body.stacks-debug-grid .stacks-masonry-container::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: var(--stack-debug-grid-images, none);
    background-size: var(--stack-debug-grid-sizes, auto);
    background-position: var(--stack-debug-grid-positions, 0 0);
    background-repeat: var(--stack-debug-grid-repeats, repeat);
}

.stack-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
}

.stack-card.positioned {
    transition: none;
}

.stack-card:hover {
    border-color: var(--text-muted);
}

.stack-card.wide {
    z-index: 2;
}

.stack-card-cover-wrap {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-card-cover {
    position: absolute;
    inset: -1px;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    aspect-ratio: auto;
    display: block;
    object-fit: contain;
    background: var(--bg-body);
}

.stack-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.stack-card-content-wrapper {
    display: flex;
    flex-direction: column;
    flex-shrink: 1;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 12px;
}

.stack-card-type,
.stack-card-title,
.stack-card-meta {
    flex-shrink: 0;
}

.stack-card-review {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    flex-shrink: 0;
    min-height: auto;
    display: block;
    overflow: visible;
}

.card-stretch-spacer {
    width: 100%;
    pointer-events: none;
    flex-shrink: 0;
}

.stack-card-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    flex-shrink: 0;
    padding-top: 8px;
}

.stack-card-type {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.stack-card-title {
    font-family: var(--font-sans);
    font-size: 1rem;
    margin: 0 0 8px 0;
    color: var(--text-main);
    line-height: 1.4;
}

.stack-card-title a {
    text-decoration: none;
    color: inherit;
    pointer-events: none;
}

.stack-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stack-card-creator {
    font-style: italic;
}

.stack-card-year {
    font-family: var(--font-mono);
}

.stack-card-footer .tag-item {
    font-size: 0.7rem;
}

.stack-item-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    margin-left: auto;
}

.stack-rating-dots {
    display: inline-flex;
    gap: 2px;
}

.stack-rating-dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
    display: inline-block;
    box-sizing: border-box;
    flex-shrink: 0;
}

.stack-rating-dot.full {
    background-color: var(--accent);
}

.stack-rating-dot.half-right {
    background: linear-gradient(90deg, transparent 50%, var(--accent) 50%);
}

.stacks-loading-more {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Stack Modal 弹窗 --- */
.stack-modal {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 0;
    width: min(980px, 92vw);
    max-width: 1000px;
    max-height: 88vh;
    padding: 0;
    overflow: hidden;
}

.stack-modal:focus,
.stack-modal:focus-visible {
    outline: none;
}

.stack-modal::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.stack-modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-body);
}

.stack-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-family: var(--font-sans);
}

.stack-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    outline: none;
}

.stack-modal-close:focus {
    outline: none;
}

.stack-modal-close:hover {
    color: var(--text-main);
}

.stack-modal-body {
    padding: 22px;
    overflow-y: auto;
    max-height: calc(88vh - 65px);
    display: block;
}

.stack-modal-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stack-modal-section {
    border: 1px solid var(--border-color);
    padding: 14px;
    background: var(--bg-elevated);
}

.stack-modal-section-title {
    margin: 0 0 12px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    letter-spacing: 0.04em;
}

.stack-modal-text {
    margin: 0;
    line-height: 1.8;
    color: var(--text-main);
    font-size: 0.98rem;
}

.stack-modal-cover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 10px;
}

.stack-modal-cover-item {
    margin: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.stack-modal-cover-thumb {
    width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    display: block;
    background: var(--bg-body);
}

.stack-modal-cover-meta {
    padding: 8px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.stack-modal-cover-size {
    color: var(--text-main);
    text-align: right;
}

.stack-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.stack-modal-type {
    font-size: 0.74rem;
    color: var(--accent);
    border: 1px solid var(--accent-subtle);
    padding: 4px 8px;
}

.stack-modal-creator {
    font-family: var(--font-serif);
    color: var(--text-main);
}

.stack-modal-year {
    font-family: var(--font-mono);
}

.stack-modal-avg-score {
    margin: 0;
    color: var(--text-main);
    font-family: var(--font-sans);
}

.stack-modal-avg-score strong {
    margin-left: 8px;
    color: var(--accent);
    font-size: 1.1rem;
}

.stack-review-card {
    margin: 0;
}

.stack-review-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.stack-review-date {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-mono);
}

.stack-review-score {
    margin: 0;
    color: var(--accent);
    font-size: 0.9rem;
    font-family: var(--font-sans);
}

.stack-review-short {
    margin: 0 0 8px 0;
}

.stack-review-short-wrap p {
    margin: 0;
}

.stack-review-long-wrap {
    margin: 0;
}

.stack-review-long-wrap p {
    margin: 0 0 8px 0;
    color: var(--text-main);
}

.stack-review-long-wrap a,
.stack-review-long-wrap strong,
.stack-review-long-wrap em,
.stack-review-long-wrap code {
    color: inherit;
}

.stack-review-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.stack-review-control-btn {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.stack-review-control-btn:hover,
.stack-review-control-btn.is-active {
    color: var(--text-main);
    border-color: var(--accent);
}

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

.stack-link-item {
    display: block;
    margin-bottom: 8px;
    word-break: break-all;
    color: var(--text-main);
}

.stack-link-item:last-child {
    margin-bottom: 0;
}

.stack-modal .markdown,
.stack-review-long {
    color: var(--text-main);
}

/* --- 12. Stack Detail 页面 --- */
.stack-detail-shell {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
}

.stack-detail-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 16px 0 34px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-dim);
}

.stack-detail-back {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.stack-detail-back:hover {
    color: var(--text-main);
}

.stack-detail-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.72rem;
    line-height: 1.2;
    font-family: var(--font-sans);
    border: 1px solid transparent;
}

.stack-type-book {
    color: var(--stack-book-fg);
    background: var(--stack-book-bg);
}

.stack-type-movie {
    color: var(--stack-movie-fg);
    background: var(--stack-movie-bg);
}

.stack-type-game {
    color: var(--stack-game-fg);
    background: var(--stack-game-bg);
}

.stack-type-music {
    color: var(--stack-music-fg);
    background: var(--stack-music-bg);
}

.stack-type-anime {
    color: var(--stack-anime-fg);
    background: var(--stack-anime-bg);
}

.stack-type-drama {
    color: var(--stack-drama-fg);
    background: var(--stack-drama-bg);
}

.stack-detail-page {
    animation: fadeInUp 0.3s ease;
}

.stack-detail-header {
    display: block;
    text-align: center;
    margin-bottom: 42px;
}

.stack-detail-header.has-cover {
    display: block;
}

.stack-detail-hero-cover {
    width: min(240px, 52vw);
    aspect-ratio: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 24px;
    border: 0;
    background: transparent;
    box-shadow: var(--shadow-sm);
}

.stack-detail-header-content h1,
.stack-detail-header-content .stack-detail-title {
    margin: 0;
    font-family: var(--font-sans);
    line-height: 1.3;
    font-size: clamp(1.65rem, 3.2vw, 2.15rem);
    color: var(--text-main);
}

.stack-detail-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.stack-detail-header-score {
    margin: -2px 0 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
}

.stack-detail-header-meta {
    display: grid;
    gap: 10px;
    justify-items: center;
    width: 100%;
}

.stack-detail-header-meta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 14px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stack-detail-header-tags {
    display: flex;
    justify-content: center;
    width: 100%;
}

.stack-detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.stack-detail-header-meta-row .stack-detail-meta-item:not(:first-child)::before {
    content: "·";
    color: var(--text-dim);
    margin-right: 6px;
}

.stack-detail-meta-tags {
    text-transform: none;
}

.stack-detail-header-tags .tag-list {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.stack-detail-header-tags .tag-item {
    font-size: 0.8rem;
    color: var(--text-main);
}

.stack-detail-header-tags .tag-item + .tag-item {
    margin-left: 0;
}

.stack-detail-score {
    color: var(--text-main);
}

.stack-detail-section {
    margin: 0 0 34px;
    padding: 0;
    border: 0;
    background: none;
}

.stack-detail-section + .stack-detail-section {
    padding-top: 26px;
    border-top: 1px solid var(--border-subtle);
}

.stack-detail-section > h2 {
    margin: 0 0 18px;
    font-size: 1.38rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.32em;
}

.stack-detail-text {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.95;
    font-size: 1.05rem;
}

.stack-detail-markdown {
    color: var(--text-muted);
    line-height: 1.95;
    font-size: 1.05rem;
}

.stack-detail-markdown p {
    margin: 0 0 1.35em 0;
}

.stack-detail-markdown h2,
.stack-detail-markdown h3,
.stack-detail-markdown h4,
.stack-detail-markdown h5,
.stack-detail-markdown h6 {
    font-family: var(--font-sans);
    line-height: 1.35;
    margin: 1.8em 0 0.7em;
    color: var(--text-main);
}

.stack-detail-markdown h2 {
    font-size: 1.38rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.32em;
}

.stack-detail-markdown h3 {
    font-size: 1.18rem;
}

.stack-detail-markdown h4 {
    font-size: 1.08rem;
}

.stack-detail-markdown h5,
.stack-detail-markdown h6 {
    font-size: 1rem;
}

.stack-detail-markdown ul,
.stack-detail-markdown ol {
    margin: 0 0 1.5em 1.4em;
    padding-left: 1.2em;
}

.stack-detail-markdown ul {
    list-style: disc;
}

.stack-detail-markdown ol {
    list-style: decimal;
}

.stack-detail-markdown li {
    margin: 0.25em 0;
    padding-left: 0.2em;
    color: var(--text-muted);
}

.stack-detail-markdown li::marker {
    color: var(--accent);
    font-family: var(--font-mono);
}

.stack-detail-markdown blockquote {
    margin: 1.8em 0;
    padding: 0.2em 0 0.2em 1.2em;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

.stack-detail-markdown code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--text-main);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 0.08em 0.28em;
}

.stack-detail-markdown > :first-child {
    margin-top: 0;
}

.stack-detail-markdown > :last-child {
    margin-bottom: 0;
}

.stack-detail-markdown a,
.stack-detail-markdown strong,
.stack-detail-markdown em,
.stack-detail-markdown code {
    color: var(--text-main);
}

.stack-detail-markdown .post-figure {
    margin: 1.8em 0;
}

.stack-detail-markdown .post-figure img {
    width: min(100%, 680px);
    height: auto;
    display: block;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.stack-detail-cover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 16px;
}

.stack-detail-cover-item {
    margin: 0;
}

.stack-detail-cover-thumb {
    width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    display: block;
    background: transparent;
    box-shadow: var(--shadow-sm);
}

.stack-detail-cover-meta {
    padding: 8px 2px 0;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    line-height: 1.5;
}

.stack-detail-cover-size {
    color: var(--text-main);
}
.stack-detail-section .stack-review-card {
    color: var(--text-muted);
}

.stack-detail-section .stack-review-card + .stack-review-card {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border-subtle);
}

.stack-detail-review-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 14px;
}

.stack-detail-review-heading {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.18rem;
    line-height: 1.32;
    color: var(--text-main);
    flex: 1 1 auto;
}

.stack-detail-review-meta {
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.76rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    white-space: nowrap;
    flex: 0 0 auto;
}

.stack-detail-review-score,
.stack-detail-review-date {
    display: inline;
}

.stack-detail-review-sep {
    color: var(--text-dim);
}

.stack-detail-section .stack-review-long,
.stack-detail-section .stack-review-long p {
    color: var(--text-muted);
    line-height: 1.95;
    font-size: 1.05rem;
}

.stack-detail-section .stack-review-long p:last-child {
    margin-bottom: 0;
}

.stack-detail-links-pairs {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stack-detail-link-pair {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stack-detail-link-label {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.02rem;
    line-height: 1.4;
    color: var(--text-main);
}

.stack-detail-link-value {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.8;
}

.stack-detail-link-value a {
    color: var(--text-main);
    word-break: break-all;
}

.stack-detail-empty {
    margin: 0;
    color: var(--text-muted);
}

.stack-detail-empty,
.stack-detail-text,
.stack-detail-markdown {
    font-family: var(--font-serif);
    font-size: 0.98rem;
}

@media (max-width: 960px) {
    .stack-detail-shell {
        max-width: calc(100vw - 24px);
    }

    .stack-detail-hero-cover {
        width: min(220px, 58vw);
    }

    .stack-detail-header-meta {
        gap: 8px;
    }

    .stack-detail-header-meta-row .stack-detail-meta-item:not(:first-child)::before {
        margin-right: 4px;
    }

    .stack-detail-review-head {
        flex-direction: column;
        gap: 8px;
    }

    .stack-detail-review-meta {
        align-items: flex-start;
        gap: 6px;
    }

}

@media (min-width: 768px) {
    .stack-modal-body {
        max-height: calc(88vh - 70px);
    }

    .stack-modal-cover-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 12. Stacks 页面 --- */
.stacks-filter,
.posts-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.posts-filter {
    gap: 14px;
    margin-top: -8px;
    margin-bottom: 32px;
    padding-bottom: 14px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.stacks-filter {
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: 0;
}

.posts-filter-track {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 14px;
    overflow: hidden;
    align-items: baseline;
}

.posts-filter-track::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 64px;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0),
        var(--bg-body) 82%
    );
    opacity: 0;
    transition: opacity 0.22s ease;
}

.posts-filter.is-collapsible:not(.expanded) .posts-filter-track::after {
    opacity: 1;
}

.posts-filter.is-collapsible {
    flex-wrap: nowrap;
}

.posts-filter.expanded .posts-filter-track {
    flex: 1 1 0;
    flex-wrap: wrap;
    overflow: visible;
}

.posts-filter.expanded .posts-filter-track::after {
    opacity: 0;
}

.posts-filter.expanded {
    flex-wrap: nowrap;
}

.posts-filter-toggle {
    appearance: none;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}

.posts-filter-toggle:hover {
    color: var(--text-main);
}

.posts-filter-btn {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    letter-spacing: 0;
    white-space: nowrap;
    transition:
        color 0.18s ease,
        opacity 0.18s ease;
}

.posts-filter-btn::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 1px;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.posts-filter-btn:hover {
    color: var(--text-main);
}

.posts-filter-btn:hover {
    border-color: transparent;
}

.posts-filter-btn.active {
    color: var(--accent);
}

.posts-filter-btn.active::after {
    opacity: 0.55;
}

.posts-filter-count {
    font-family: var(--font-mono);
    margin-left: 4px;
    color: var(--text-dim);
    font-size: 0.72rem;
    opacity: 1;
    white-space: nowrap;
}

.tag-picker-option-count {
    font-family: var(--font-mono);
    letter-spacing: 0;
}

/* --- 13. 移动端响应式 --- */
@media (max-width: 720px) {
    .container {
        padding: 0 14px 60px;
    }

    .nav-header {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 20px 0;
        gap: 14px;
        margin-bottom: 40px;
    }

    .logo-wrapper {
        width: 100%;
        align-items: center;
        justify-content: center;
        gap: 0;
    }

    .site-mark {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .site-logo {
        display: none;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px 14px;
    }

    .nav-item {
        font-size: 0.82rem;
    }

    .site-footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
        gap: 12px;
    }

    .site-footer-center {
        grid-column: 1 / -1;
        order: 2;
        align-items: center;
        justify-self: center;
    }

    .site-footer-theme {
        order: 1;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .site-footer-account {
        order: 1;
        align-items: flex-start;
        justify-content: flex-end;
    }

    .site-footer-user {
        align-items: flex-start;
        justify-content: flex-end;
    }

    .site-footer-copy {
        text-align: center;
        white-space: normal;
    }

    .site-footer-beian {
        text-align: center;
        white-space: normal;
    }

    h1 {
        font-size: 1.8rem;
        margin-top: 1.5em;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .social-links {
        justify-content: center;
    }

    .about-contact-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .about-contact-value {
        text-align: left;
    }

    .about-contact-grid {
        grid-template-columns: 1fr;
    }

    .about-link-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .posts-filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .posts-filter {
        gap: 12px;
    }

    .posts-filter-track {
        gap: 12px;
    }

    .posts-filter-btn {
        padding: 0;
        font-size: 0.76rem;
    }

    .posts-filter-toggle {
        font-size: 0.74rem;
    }
}

/* --- 14. Chirp --- */
.chirp-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.chirp-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.9;
}

.chirp-meta-topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
}

.chirp-meta-primary {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.chirp-meta-tags {
    min-width: 0;
}

.chirp-meta-tags-block {
    display: none;
}

.chirp-date {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.chirp-visibility-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    opacity: 0.88;
    flex: 0 0 auto;
    transform: translateY(3px);
}

.chirp-visibility-icon {
    display: inline-block;
    width: 100%;
    height: 100%;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.icon-eye {
    -webkit-mask-image: url("/assets/ui/eye.svg");
    mask-image: url("/assets/ui/eye.svg");
}

.icon-team {
    -webkit-mask-image: url("/assets/ui/team.svg");
    mask-image: url("/assets/ui/team.svg");
}

.icon-lock {
    -webkit-mask-image: url("/assets/ui/lock.svg");
    mask-image: url("/assets/ui/lock.svg");
}

.chirp-visibility-public {
    color: color-mix(in srgb, var(--text-muted) 78%, var(--accent) 22%);
}

.chirp-visibility-protected {
    color: color-mix(in srgb, var(--accent) 72%, var(--text-main) 28%);
}

.chirp-visibility-private {
    color: color-mix(in srgb, var(--color-error) 76%, var(--text-main) 24%);
}

.chirp-tags,
.chirp-pill-btn {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: 0;
    line-height: 1.6;
}

.chirp-tags {
    margin-left: 12px;
}

.chirp-pill-btn {
    margin-left: 12px;
    cursor: pointer;
    background: var(--bg-card);
}

.chirp-pill-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.chirp-content {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 8px 0 12px 0;
}

.chirp-interactions {
    display: inline-flex;
    align-items: baseline;
    gap: 18px;
    font-family: var(--font-mono);
    flex: 0 0 auto;
}

.chirp-interaction-btn {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    cursor: pointer;
    font: inherit;
    transition:
        color 0.18s ease,
        opacity 0.18s ease;
}

.chirp-interaction-btn:hover {
    color: var(--accent);
}

.chirp-interaction-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

.chirp-like-pill.liked {
    color: var(--accent);
}

.chirp-interaction-label,
.chirp-interaction-count {
    font-size: 0.82rem;
    letter-spacing: 0;
}

.chirp-images-single img,
.chirp-media-single {
    margin-top: 12px;
    max-width: 400px;
}

.chirp-images-single img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 0;
    border: 1px solid var(--border-color);
    display: block;
}

.chirp-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.chirp-images-grid img {
    height: 200px;
    width: auto;
    max-width: 100%;
    border-radius: 0;
    border: 1px solid var(--border-color);
    background: var(--border-color);
    transition: opacity 0.3s;
}

.chirp-images-grid img:hover {
    opacity: 0.9;
}

.chirp-media-grid {
    margin-top: 12px;
    display: grid;
    max-width: 400px;
    gap: 8px;
}

/* 2张图：2列 */
.chirp-media-grid[data-count="2"] {
    grid-template-columns: repeat(2, 1fr);
}

/* 3张图：3列 */
.chirp-media-grid[data-count="3"] {
    grid-template-columns: repeat(3, 1fr);
}

/* 4张图：2列2行 */
.chirp-media-grid[data-count="4"] {
    grid-template-columns: repeat(2, 1fr);
}

/* 5-6张图：3列 */
.chirp-media-grid[data-count="5"],
.chirp-media-grid[data-count="6"] {
    grid-template-columns: repeat(3, 1fr);
}

/* 7-9张图：3列 */
.chirp-media-grid[data-count="7"],
.chirp-media-grid[data-count="8"],
.chirp-media-grid[data-count="9"] {
    grid-template-columns: repeat(3, 1fr);
}

.chirp-media-grid .chirp-media {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.chirp-media {
    width: 100%;
    border-radius: 0;
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chirp-media:hover {
    opacity: 0.85;
}

/* --- Chirp Image Modal --- */
.chirp-image-modal {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 95vw;
    max-height: 95vh;
}

.chirp-image-modal::backdrop {
    background: rgba(0, 0, 0, 0.9);
}

.chirp-image-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 2rem;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.chirp-image-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.chirp-image-modal-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    display: block;
}

.chirp-actions {
    margin-top: 10px;
}

.chirp-toggle-comments,
.chirp-submit-comment,
.chirp-cancel-reply,
.chirp-dialog-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.chirp-toggle-comments:hover,
.chirp-submit-comment:hover,
.chirp-cancel-reply:hover,
.chirp-dialog-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.chirp-submit-comment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chirp-comments {
    margin-top: 12px;
    padding-top: 10px;
}

.chirp-comments[hidden] {
    display: none;
}

.chirp-comments-body {
    margin-top: 8px;
    padding-left: 2px;
    font-family: var(--font-sans);
}

.chirp-comments-empty {
    opacity: 0.7;
    padding: 6px 0;
    font-family: var(--font-sans);
    color: var(--text-muted);
}

.chirp-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chirp-comment {
    margin-left: calc(var(--chirp-depth, 0) * 14px);
    padding: 9px 0 7px 0;
}

.chirp-comment + .chirp-comment {
    border-top: 0;
}

.chirp-comment-children {
    margin-top: 6px;
    padding-left: 10px;
}

.chirp-comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
    color: var(--text-muted);
}

.chirp-comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chirp-comment-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-card);
}

.chirp-comment-author-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.chirp-comment-userid {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    line-height: 1.2;
    color: var(--text-muted);
    opacity: 0.92;
}

.chirp-comment-time {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1.2;
    color: var(--text-muted);
    opacity: 0.64;
}

.chirp-reply-btn {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: underline;
}

.chirp-reply-btn:hover {
    opacity: 1;
}

.chirp-comment-content {
    font-family: var(--font-serif);
    font-size: 0.97rem;
    line-height: 1.6;
    color: var(--text-muted);
    opacity: 0.94;
    word-break: break-word;
    white-space: pre-wrap;
}

.chirp-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    opacity: 0.82;
}

.chirp-replying {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    opacity: 0.75;
    color: var(--text-muted);
}

.chirp-comment-form textarea.chirp-comment-input,
.chirp-comment-input,
.chirp-dialog-text {
    width: 100%;
    resize: vertical;
    border-radius: 0;
    min-height: 96px;
    padding: 10px 88px 12px 0;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-serif);
    font-size: 0.98rem;
    line-height: 1.7;
    box-sizing: border-box;
    outline: none;
}

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

.chirp-comment-form-actions,
.chirp-dialog-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.chirp-dialog-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

.chirp-dialog {
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0;
    max-width: 560px;
    width: calc(100vw - 32px);
}

.chirp-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.chirp-dialog-form {
    padding: 16px;
}

.chirp-dialog-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.chirp-dialog-primary {
    color: var(--text-main);
}

/* --- 15. Admin 样式 --- */
.admin-login-card {
    width: min(560px, calc(100vw - 32px));
}

.admin-login-title {
    margin-top: 0;
    margin-bottom: 24px;
    font-family: var(--font-sans);
}

.admin-login-actions {
    margin-top: 8px;
}

.admin-error {
    color: var(--color-error);
    font-size: 0.85rem;
    margin-top: 12px;
    font-family: var(--font-mono);
    line-height: 1.6;
    white-space: pre-wrap;
}

.admin-debug-wrap {
    margin-bottom: 20px;
}

.admin-log-card {
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-card);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.admin-log-card-login {
    margin-top: 18px;
    margin-bottom: 0;
}

.admin-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.admin-log-title {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-log-output {
    margin: 0;
    min-height: 88px;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-mono);
    font-size: 0.83rem;
    line-height: 1.7;
    color: var(--text-main);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 10px 12px;
}

.admin-server-meta {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.admin-field-help {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.admin-field-help code {
    font-family: var(--font-mono);
}

.admin-upload-success {
    color: var(--color-success);
    font-family: var(--font-mono);
    font-weight: bold;
    margin-bottom: 8px;
}

.admin-upload-label {
    display: block;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.admin-chirp-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-chirp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-chirp-idline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.admin-chip-label {
    color: var(--text-muted);
}

.admin-chip-value {
    display: inline-block;
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 2px 8px;
    background: var(--bg-body);
    color: var(--text-main);
}

.admin-btn-toggle.active {
    border-color: var(--text-main);
    color: var(--text-main);
}

.admin-chirp-upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-chirp-upload-row .admin-input {
    flex: 1;
}

.admin-chirp-media-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-chirp-media-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

@media (max-width: 720px) {
    .admin-chirp-upload-row,
    .admin-chirp-media-row {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* Admin base styles */
.admin-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 96px;
    color: var(--text-main);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-btn {
    appearance: none;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 9px 14px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.2;
    cursor: pointer;
    border-radius: 0;
    transition:
        border-color 0.2s,
        color 0.2s,
        background-color 0.2s,
        opacity 0.2s;
}

.page-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 40px;
}

.page-title-bar h1 {
    margin: 0;
}

.page-admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chirps-admin-dock {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 210;
    gap: 8px;
}

.chirps-admin-dock[hidden] {
    display: none !important;
}

.page-admin-actions-top {
    justify-content: flex-end;
    margin-bottom: 28px;
}

.page-admin-create-btn {
    appearance: none;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 210;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    box-shadow: none;
    text-decoration: none;
    transform: translateY(0);
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.chirps-admin-dock .page-admin-create-btn {
    position: static;
    right: auto;
    bottom: auto;
    z-index: auto;
}

.page-admin-create-btn i {
    font-size: 0.95rem;
    line-height: 1;
    pointer-events: none;
}

.page-admin-create-btn[hidden] {
    display: none !important;
}

.page-admin-create-btn:hover,
.page-admin-create-btn.admin-btn-primary:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--bg-elevated);
    transform: translateY(-1px);
    text-decoration: none;
}

.page-admin-create-btn.admin-btn-primary {
    color: var(--text-main);
    border-color: var(--border-color);
    background: var(--bg-elevated);
}

.page-admin-create-btn:focus-visible,
.page-admin-create-btn.admin-btn-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.page-admin-notification {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 220;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.84rem;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition:
        opacity 0.2s,
        transform 0.2s;
}

.page-admin-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.admin-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.admin-btn.active {
    border-color: var(--text-main);
    color: var(--text-main);
    background: var(--bg-body);
}

.admin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.admin-btn-primary {
    background: var(--text-main);
    color: var(--bg-card);
    border-color: var(--text-main);
}

.admin-btn-primary:hover {
    opacity: 0.9;
    color: var(--bg-card);
}

.admin-btn-danger {
    border-color: var(--color-error);
    color: var(--color-error);
}

.admin-btn-danger:hover {
    background: var(--accent-subtle);
    color: var(--color-error);
}

.admin-form-group {
    margin-bottom: 16px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.admin-input,
.admin-textarea,
.admin-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-radius: 0;
    transition: border-color 0.2s;
}

.admin-input,
.admin-select {
    height: 38px;
}

.admin-textarea {
    min-height: 80px;
    resize: vertical;
}

.chirp-comment-composer {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.chirp-comment-composer[hidden] {
    display: none;
}

.chirp-comment-form-actions {
    position: absolute;
    right: 0;
    bottom: 14px;
    display: flex;
    justify-content: flex-end;
    padding-top: 0;
    pointer-events: none;
}

.chirp-comment-form-actions .chirp-submit-comment {
    pointer-events: auto;
    font-family: var(--font-serif);
    font-size: 0.92rem;
    color: var(--text-main);
}

.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
    outline: none;
    border-color: var(--text-main);
}

.admin-input::placeholder,
.admin-textarea::placeholder {
    color: var(--text-dim);
}

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.admin-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 24px;
    max-width: 480px;
    width: 90%;
}

.admin-split {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
}

.admin-sidebar {
    border-right: 1px solid var(--border-color);
    padding-right: 24px;
}

.admin-main {
    min-width: 0;
}

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

.admin-list-item {
    display: block;
    width: 100%;
    padding: 12px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--text-muted);
    transition: color 0.15s;
}

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

.admin-list-item:hover,
.admin-list-item.active {
    color: var(--accent);
}

.admin-empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border: 1px dashed var(--border-color);
    background: var(--bg-card);
}

.admin-mb-card {
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-card);
    padding: 20px;
    margin-bottom: 20px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.admin-flex-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 16px 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.3s,
        transform 0.3s;
}

.admin-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.admin-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 0;
    background: var(--accent);
    color: var(--bg-card);
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}

.admin-fab:hover {
    transform: scale(1.05);
}

.admin-gallery-item {
    display: block;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: border-color 0.2s;
}

.admin-gallery-item:hover {
    border-color: var(--accent);
}

.admin-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

@media (max-width: 980px) {
    .admin-split {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        border-right: none;
        padding-right: 0;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 720px) {
    .admin-layout {
        padding: 20px 16px 80px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-fab {
        bottom: 16px;
        right: 16px;
    }

    .admin-notification {
        right: 16px;
        left: 16px;
    }

    .post-editor-grid {
        grid-template-columns: 1fr;
    }

    .post-attachment-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .post-attachment-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .post-attachment-rename {
        flex-wrap: wrap;
    }

    .page-admin-notification {
        right: 16px;
        left: 16px;
        bottom: 16px;
    }

    .chirps-admin-dock {
        right: 16px;
        bottom: 16px;
    }

    .page-title-bar {
        align-items: flex-start;
    }
}

.admin-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table thead th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.admin-table tbody tr:nth-child(even) {
    background: var(--bg-body);
}

.admin-table tbody tr:hover {
    background: var(--accent-subtle);
}

.admin-table-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.admin-cell-center {
    text-align: center;
}

.admin-chirp-content-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chirp-editor-dialog {
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0;
    max-width: 1120px;
    width: calc(100vw - 32px);
}

.chirp-editor-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.chirp-editor-form {
    padding: 20px;
}

.chirp-editor-toprow {
    display: flex;
    gap: 16px;
}

.chirp-editor-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

@media (max-width: 900px) {
    .chirp-editor-form {
        padding: 16px;
    }

    .admin-table {
        font-size: 0.8rem;
    }
}

.admin-cell-center {
    text-align: center;
}

.admin-chirp-content-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chirp-editor-dialog {
    max-width: calc(100vw - 16px);
}

.chirp-editor-form {
    padding: 16px;
}

.chirp-editor-toprow {
    flex-direction: column;
    gap: 12px;
}

.chirp-editor-toprow .admin-form-group {
    flex: 1;
    min-width: 0;
}

.chirp-editor-toprow .admin-input,
.chirp-editor-toprow .admin-btn-toggle {
    flex: 1;
}

.chirp-editor-toprow .admin-btn-toggle {
    width: 100%;
    justify-content: center;
}

.chirp-editor-actions {
    flex-wrap: wrap;
}

.admin-file-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-file-input {
    display: none;
}

.admin-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px dashed var(--border-color);
    background: var(--bg-body);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
}

.admin-file-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.admin-file-empty {
    color: var(--text-muted);
    line-height: 1.5;
}

.admin-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    max-width: 100%;
    padding: 0 10px 0 12px;
    border-radius: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
}

.admin-file-chip-name {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.94rem;
    color: var(--text-main);
}

.admin-file-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 0;
    background: var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
}

.admin-file-chip-remove:hover {
    background: var(--accent);
    color: var(--bg-card);
}

.post-editor-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.post-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.post-editor-body {
    flex: 1 1 auto;
    min-height: 0;
}

.tag-picker {
    position: relative;
}

.tag-picker-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.tag-picker-input-slot {
    min-width: 0;
}

.tag-picker-input-slot .admin-input {
    width: 100%;
}

.tag-picker-toggle {
    min-width: 90px;
    justify-content: center;
}
.tag-picker-toggle.admin-btn-icon {
    min-width: 24px;
}

.tag-picker-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

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

.tag-picker-empty {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.tag-picker-option {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease;
}

.tag-picker-option:hover {
    border-color: var(--accent);
}

.tag-picker-option.active {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.tag-picker-option-name {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.tag-picker-option-count {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.post-editor-textarea {
    min-height: 340px;
    height: min(62vh, 840px);
}

.post-attachments-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.post-attachments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.post-attachments-hint {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.post-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
}

.post-attachment-row.is-cover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.post-attachment-leading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.post-attachment-thumb {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px;
    display: block;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    border-radius: 4px;
}

.post-attachment-thumb-file {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.post-attachment-name-btn {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-attachment-name-btn:hover {
    color: var(--accent);
}

.post-attachment-name-static {
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-attachment-rename {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.post-attachment-rename-input {
    min-width: 0;
    flex: 1 1 220px;
}

.post-attachment-ext {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    white-space: nowrap;
}

.post-attachment-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.post-attachment-actions .admin-btn {
    padding: 8px 10px;
    font-size: 0.76rem;
}

.chirp-editor-textarea {
    min-height: 0;
    height: calc(1.55em * 3 + 22px);
    max-height: calc(1.55em * 3 + 22px);
    line-height: 1.55;
    resize: none;
    overflow-y: auto;
}

.chirp-editor-surface .post-editor-layout {
    display: grid;
    gap: 14px;
}

.chirp-editor-surface .post-editor-header {
    align-items: center;
    margin-bottom: 14px;
}

.chirp-editor-surface .post-editor-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.chirp-editor-surface .stack-field label {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.chirp-editor-surface .field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
}

.chirp-editor-surface .chirp-media-label-row {
    justify-content: flex-start;
    min-height: 30px;
    gap: 8px;
}

.chirp-editor-surface .tag-picker-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.chirp-editor-surface .tag-picker-input-slot .admin-input {
    height: 100%;
    box-sizing: border-box;
}

.chirp-editor-surface .tag-picker-toggle.admin-btn-icon {
    width: auto;
    min-width: 0;
    height: 100%;
    min-height: 0;
    aspect-ratio: 1;
    padding: 0;
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    line-height: 1;
}

.chirp-editor-surface .chirp-media-upload-btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    font-size: 0.82rem;
    line-height: 1;
}

.chirp-editor-surface .chirp-media-upload-btn:hover,
.chirp-editor-surface .chirp-media-upload-btn:focus-visible {
    background: transparent;
    color: var(--text-main);
}

.chirp-editor-surface .post-attachments-panel,
.chirp-editor-surface .chirp-visibility-panel {
    border: 0;
    padding: 0;
    background: transparent;
}

.chirp-editor-surface .post-attachments-toolbar {
    justify-content: flex-start;
    margin-bottom: 8px;
}

.chirp-editor-surface .post-attachments-list {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 8px;
}

.chirp-editor-surface .chirp-editor-media-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    overflow: hidden;
}

.chirp-editor-surface .chirp-editor-media-card .post-attachment-leading {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    flex: none;
}

.chirp-editor-surface .chirp-editor-media-card .post-attachment-thumb {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1;
    border: 0;
    border-radius: 0;
    flex: none;
}

.chirp-editor-surface .chirp-editor-media-card .post-attachment-thumb-file {
    display: grid;
    place-items: center;
}

.chirp-editor-surface .chirp-editor-media-card .post-attachment-actions {
    position: absolute;
    top: 6px;
    right: 6px;
}

.chirp-editor-surface .chirp-editor-media-card .post-attachment-actions .admin-btn {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
}

.chirp-editor-surface .chirp-visibility-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.chirp-editor-surface .chirp-visibility-static {
    color: var(--text-muted);
}

.chirp-editor-surface .chirp-visibility-select,
.chirp-editor-surface .chirp-visibility-static,
.chirp-editor-surface .chirp-group-picker-host .admin-input {
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
}

.chirp-editor-surface .chirp-group-picker-host[hidden],
.chirp-editor-surface .chirp-visibility-static[hidden] {
    display: none !important;
}

.chirp-editor-surface .chirp-group-picker-host .admin-input[readonly] {
    cursor: default;
}

.chirp-editor-surface .user-form-actions {
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 14px;
}

.chirp-editor-surface .user-form-actions .admin-btn-primary {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.84rem;
}

.chirp-visibility-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.chirp-visibility-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.chirp-visibility-option,
.chirp-group-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chirp-visibility-option input,
.chirp-group-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chirp-visibility-pill {
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.chirp-visibility-pill:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.chirp-visibility-pill:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--text-main);
    box-shadow: inset 0 0 0 1px var(--accent-subtle);
}

.chirp-visibility-pill-title {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    color: var(--text-main);
}

.chirp-visibility-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.chirp-visibility-groups[hidden] {
    display: none;
}

.chirp-group-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 150px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.chirp-group-toggle:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.chirp-group-toggle:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.chirp-group-toggle:has(input:disabled) {
    cursor: default;
    opacity: 0.9;
}

.chirp-group-toggle-name {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-main);
}

.chirp-group-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
}

@media (max-width: 720px) {
    .chirp-editor-surface .post-attachments-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .chirp-editor-surface .chirp-visibility-row {
        grid-template-columns: 1fr;
    }

    .chirp-visibility-modes {
        grid-template-columns: 1fr;
    }
}

/* --- 16. User Admin Styles --- */
.user-admin-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 96px;
    color: var(--text-main);
}

.user-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-admin-title {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    margin: 0;
}

.user-admin-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-admin-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.user-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.user-card:hover {
    border-color: var(--accent);
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.user-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 0;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.user-card-name {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.user-card-id {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.user-card-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-card-detail-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-card-detail-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-card-aliases {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-card-alias {
    padding: 2px 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-card-groups {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-card-group {
    padding: 4px 10px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
}

.user-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.group-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 20px;
    margin-bottom: 16px;
}

.group-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.group-card-name {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.group-card-id {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.group-card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 8px 0;
}

.group-card-members {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.group-card-member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.group-card-member {
    padding: 2px 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-login-panel {
    max-width: 480px;
    margin: 80px auto;
    padding: 0 24px;
}

.user-login-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 32px;
}

.user-login-title {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    margin: 0 0 24px;
    text-align: center;
}

.current-user-panel {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-user-info {
    flex: 1;
}

.current-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 0;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--bg-card);
    flex-shrink: 0;
}

.current-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.current-user-name {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.current-user-id {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.current-user-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.user-form-panel {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 24px;
    margin-bottom: 24px;
}

.user-form-title {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.user-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.user-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 0;
    margin-right: 6px;
}

.status-active {
    background: var(--color-success);
}

.status-inactive {
    background: var(--color-error);
}

.user-empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border: 1px dashed var(--border-color);
    background: var(--bg-card);
}

.profile-card {
    display: flex;
    gap: 32px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 32px;
    margin-bottom: 24px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 0;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--bg-card);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.profile-avatar-upload {
    margin-top: 8px;
}

.profile-avatar-upload .admin-btn {
    font-size: 0.8rem;
}

.profile-info-section {
    flex: 1;
    min-width: 0;
}

.profile-field {
    margin-bottom: 16px;
}

.profile-field label {
    display: block;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-value {
    font-size: 1rem;
    color: var(--text-main);
}

.profile-edit-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 24px;
    margin-bottom: 24px;
}

.chirp-editor-dialog {
    max-width: 760px;
}

.chirp-editor-form {
    padding: 24px;
}

.chirp-selected-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chirp-file-chip {
    padding: 6px 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-card-aliases {
    margin-top: 12px;
}

.user-card-aliases code {
    font-family: var(--font-mono);
    background: var(--bg-body);
    padding: 2px 6px;
    border-radius: 0;
}

@media (max-width: 720px) {
    .user-admin-layout {
        padding: 20px 16px 80px;
    }

    .user-admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-admin-tabs {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-card {
        padding: 16px;
    }

    .user-card-actions {
        flex-direction: column;
    }

    .user-card-actions .admin-btn {
        width: 100%;
    }

    .user-form-row {
        grid-template-columns: 1fr;
    }

    .current-user-panel {
        flex-direction: column;
        text-align: center;
    }

    .current-user-info {
        width: 100%;
    }

    .current-user-groups {
        justify-content: center;
    }

    .profile-card {
        flex-direction: column;
        padding: 24px;
    }

    .profile-info-section {
        width: 100%;
    }
}

/* --- 17. 分页 --- */
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 48px;
    padding-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination-arrow {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1;
    min-width: 1.1em;
    text-align: center;
    padding: 4px 0;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease;
}

.pagination-arrow:hover {
    color: var(--text-main);
    background: var(--accent-subtle);
}

.pagination-arrow.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.pagination-status {
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    min-width: 4.5em;
    padding: 4px 6px;
}

@media (max-width: 720px) {
    .pagination {
        gap: 4px;
        padding-bottom: 32px;
        flex-wrap: nowrap;
    }
}

/* --- Builds Gallery --- */
.build-item {
    padding: 32px 0;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

.build-title {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    margin: 0;
    color: var(--text-main);
}

.build-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.build-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    text-decoration: none !important;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: var(--transition-theme);
    cursor: pointer;
    border-radius: var(--radius);
}

.build-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-elevated);
}

.brand-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    vertical-align: middle;
}

.build-gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-md);
    user-select: none;
}

@media (hover: hover) {
    .build-gallery-wrapper:hover .gallery-nav {
        opacity: 0.8;
    }
}

.gallery-nav:hover {
    opacity: 1 !important;
    background: var(--bg-elevated);
    color: var(--accent);
    border-color: var(--accent);
}

.gallery-nav.prev-nav {
    left: 16px;
}

.gallery-nav.next-nav {
    right: 16px;
}

.build-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.build-gallery::-webkit-scrollbar {
    display: none;
}

.build-gallery img, .build-gallery .build-gallery-placeholder {
    height: 280px;
    width: auto;
    max-width: 90vw;
    object-fit: cover;
    scroll-snap-align: start;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.build-gallery .build-gallery-placeholder {
    width: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.build-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* --- Builds Comments --- */
.build-comments-container {
    margin-top: 16px;
    padding: 16px 0 0 0;
    border-top: 1px dashed var(--border-subtle);
}

.build-comment {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.build-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.build-comment-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.build-comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.build-comment-author {
    color: var(--text-main);
    font-weight: 500;
}

.build-comment-time {
    color: var(--text-dim);
}

.build-comment-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}
