/* ==========================================================================
   朋友圈时间线主题 · 主样式
   布局：576px 竖屏居中 / 56px 固定顶栏 / 滚动 264px 后顶栏加背景
   ========================================================================== */

:root {
    --bg: #ededed;
    --card-bg: #ffffff;
    --text: #1b1b1b;
    --text-secondary: #8a8a8a;
    --text-tertiary: #b2b2b2;
    --border: rgba(0, 0, 0, .07);
    --divider: rgba(0, 0, 0, .045);
    --accent: #576b95;
    --accent-strong: #3d5379;
    --like: #ff6b6b;
    --badge-top-bg: rgba(255, 149, 0, .12);
    --badge-top-fg: #d97800;
    --badge-ad-bg: rgba(87, 107, 149, .12);
    --badge-ad-fg: #576b95;
    --badge-promo-bg: rgba(7, 193, 96, .12);
    --badge-promo-fg: #0a9c53;
    --badge-featured-bg: rgba(154, 95, 214, .13);
    --badge-featured-fg: #7d4fc4;
    --top-bar: transparent;
    --top-bar-text: #ffffff;
    --modal-bg: #ffffff;
    --mask: rgba(0, 0, 0, .55);
    --shadow: 0 1px 2px rgba(0, 0, 0, .04);
    --radius: 8px;
}

html.dark {
    --bg: #111214;
    --card-bg: #1c1d21;
    --text: #e8e8ea;
    --text-secondary: #9a9ba1;
    --text-tertiary: #6b6c72;
    --border: rgba(255, 255, 255, .09);
    --divider: rgba(255, 255, 255, .055);
    --accent: #91a7d6;
    --accent-strong: #b8c8e8;
    --like: #ff8080;
    --badge-top-bg: rgba(255, 170, 60, .16);
    --badge-top-fg: #ffb452;
    --badge-ad-bg: rgba(145, 167, 214, .16);
    --badge-ad-fg: #a9bde8;
    --badge-promo-bg: rgba(64, 210, 137, .16);
    --badge-promo-fg: #62d99b;
    --badge-featured-bg: rgba(186, 150, 232, .18);
    --badge-featured-fg: #c4a3ec;
    --top-bar: transparent;
    --top-bar-text: #ffffff;
    --modal-bg: #1c1d21;
    --mask: rgba(0, 0, 0, .7);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}

main {
    max-width: 576px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

/* -------------------------------- 顶栏 -------------------------------- */

.top-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    color: var(--top-bar-text);
    background: var(--top-bar);
    transition: background-color .28s ease, color .28s ease, box-shadow .28s ease, backdrop-filter .28s ease;
}

.top-container > .top-container-left,
.top-container > .top-container-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

main .top-container {
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 576px;
    transform: translateX(-50%);
}

.top-container.scrolled {
    background: var(--card-bg);
    color: var(--text);
    box-shadow: 0 1px 0 var(--border);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

.tc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: inherit;
    transition: background-color .2s ease, opacity .2s ease, transform .2s ease;
    opacity: .92;
}

.tc-icon:hover {
    background: rgba(255, 255, 255, .14);
    opacity: 1;
}

.top-container.scrolled .tc-icon:hover {
    background: rgba(127, 127, 127, .12);
}

.tc-icon:active {
    transform: scale(.94);
}

/* ------------------------- 顶部大图 / 站点信息 ------------------------- */

.header-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--card-bg);
}

/* 图片/视频底部压一层渐变，保证白色标题可读 */
.header-container::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46%;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 100%);
}

.banner-media {
    display: block;
    width: 100%;
    height: 42vh;
    min-height: 210px;
    max-height: 380px;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.banner-gradient {
    background-image: linear-gradient(150deg, #5f7fa8 0%, #8d9bb5 40%, #c8b8a8 100%);
}

.header-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    padding: 0 18px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.header-user {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.header-site-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .4px;
    line-height: 1.3;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}

.header-avatar-link {
    display: block;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .85);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    background: #fff;
}

.header-avatar-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-description {
    font-size: 13px;
    line-height: 1.5;
    opacity: .92;
}

/* ------------------------------ 内容容器 ------------------------------ */

.content-container {
    margin-top: 0;
    padding: 14px 0 40px;
}

.content-container > section,
.content-container > div {
    width: 100%;
}

.scrollload-container {
    width: 100%;
}

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

/* -------------------------------- 卡片 -------------------------------- */

.post-item,
.page-detail {
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 14px 12px;
    box-shadow: var(--shadow);
    animation: card-in .35s ease both;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.post-item-left {
    flex: 0 0 40px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    background: var(--divider);
}

.post-item-right {
    flex: 1 1 auto;
    min-width: 0;
}

.post-title {
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.post-title > a {
    color: var(--accent);
    font-weight: 600;
}

.top-badge,
.ad-badge,
.promo-badge,
.featured-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .2px;
    text-shadow: none;
}

.top-badge {
    background: var(--badge-top-bg);
    color: var(--badge-top-fg);
}

.ad-badge {
    background: var(--badge-ad-bg);
    color: var(--badge-ad-fg);
}

.promo-badge {
    background: var(--badge-promo-bg);
    color: var(--badge-promo-fg);
}

.featured-badge {
    background: var(--badge-featured-bg);
    color: var(--badge-featured-fg);
}

.post-content {
    font-size: 15px;
    line-height: 1.62;
    color: var(--text);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.post-content p {
    margin: 0 0 10px;
}

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

.post-content img {
    border-radius: 4px;
}

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

.summary,
.full_content {
    position: relative;
}

.show_all_btn,
.hide_all_btn {
    color: var(--accent);
    font-size: 14px;
    margin-left: 4px;
    padding: 0;
}

.show_all_btn:hover,
.hide_all_btn:hover {
    text-decoration: underline;
}

/* ------------------------------ 九宫格 ------------------------------ */

.post-images {
    margin-top: 10px;
    display: grid;
    gap: 4px;
}

.post-images.grid-one {
    grid-template-columns: 1fr;
    max-width: 70%;
}

.post-images.grid-two {
    grid-template-columns: repeat(2, 1fr);
    max-width: 74%;
}

.post-images.grid-four {
    grid-template-columns: repeat(2, 1fr);
    max-width: 66%;
}

.post-images.grid-three {
    grid-template-columns: repeat(3, 1fr);
}

.post-image {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: var(--divider);
    aspect-ratio: 1 / 1;
}

.post-images.grid-one .post-image,
.post-images.grid-two .post-image {
    aspect-ratio: 4 / 3;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
    cursor: zoom-in;
}

.post-image:hover img {
    transform: scale(1.03);
}

/* ------------------------------ 视频 / 音乐 ------------------------------ */

.post-video {
    margin-top: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.post-video video {
    width: 100%;
    max-height: 360px;
    display: block;
}

.post-music {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--divider);
}

.music-toggle {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: transform .2s ease;
}

.music-toggle:hover {
    transform: scale(1.06);
}

.music-icon {
    display: block;
    line-height: 1;
}

.music-info {
    flex: 1 1 auto;
    min-width: 0;
}

.music-name {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-bar {
    margin-top: 6px;
    height: 3px;
    border-radius: 2px;
    background: rgba(127, 127, 127, .2);
    overflow: hidden;
    cursor: pointer;
}

.music-progress {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width .18s linear;
}

.music-time {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* -------------------------------- 定位 -------------------------------- */

.post-position {
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-position::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .8;
}

/* ---------------------------- 时间与操作菜单 ---------------------------- */

.post-time {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-tertiary);
}

.post-time time {
    font-variant-numeric: tabular-nums;
}

.post-time-comment {
    position: relative;
    margin-right: -6px;
}

.ptc-more {
    width: 30px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--text-tertiary);
    transition: background-color .2s ease, color .2s ease;
}

.ptc-more:hover {
    background: var(--divider);
    color: var(--text-secondary);
}

.post-time-comment-modal {
    position: absolute;
    right: 0;
    bottom: 30px;
    z-index: 20;
    display: none;
    min-width: 118px;
    padding: 4px;
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .16);
    border: 1px solid var(--border);
}

.post-time-comment.active .post-time-comment-modal {
    display: flex;
}

html.dark .post-time-comment-modal {
    box-shadow: 0 8px 26px rgba(0, 0, 0, .55);
}

.ptcm-good,
.ptcm-comment {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px;
    color: var(--text);
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease;
}

.ptcm-good:hover,
.ptcm-comment:hover {
    background: var(--divider);
}

.ptcm-good.liked {
    color: var(--like);
}

.ptcm-good.liked .like-menu-icon {
    stroke: var(--like);
    fill: var(--like);
}

/* ------------------------------ 点赞 / 评论 ------------------------------ */

.post-comment-container {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--divider);
}

.pcc-like-list {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.pcc-like-summary {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--accent);
}

.like-icon {
    flex: 0 0 16px;
    margin-top: 2px;
    fill: var(--like);
    stroke: var(--like);
}

.like-users-text {
    word-break: break-word;
}

.pcc-comment-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pcc-comment-item {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    word-break: break-word;
}

.pcc-comment-item a {
    color: var(--accent);
}

.pcc-comment-item .pcc-comment-content {
    color: var(--text);
}

.pcc-comment-item .pcc-comment-content:hover {
    text-decoration: underline;
    text-decoration-color: var(--border);
}

/* ------------------------------ 回复表单 ------------------------------ */

.post-reply-form {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.reply-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.reply-form-close {
    font-size: 16px;
    line-height: 1;
    color: var(--text-tertiary);
    padding: 0 4px;
}

.reply-form-user {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.reply-form-user input,
.reply-form-body textarea,
.reply-form-actions input {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 9px;
    outline: none;
    transition: border-color .2s ease, background-color .2s ease;
}

.reply-form-user input {
    flex: 1 1 0;
    min-width: 0;
}

.reply-form-body textarea {
    width: 100%;
    resize: vertical;
    min-height: 62px;
    line-height: 1.5;
}

.reply-form-user input:focus,
.reply-form-body textarea:focus,
.reply-form-actions input:focus {
    border-color: var(--accent);
}

.reply-form-emoji {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 6px 0 2px;
}

.emoji-item {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1;
    transition: background-color .2s ease;
}

.emoji-item:hover {
    background: var(--divider);
}

.reply-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-form-actions input {
    flex: 1 1 auto;
    min-width: 0;
}

.reply-submit {
    flex: 0 0 auto;
    padding: 7px 16px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    transition: opacity .2s ease, transform .2s ease;
}

.reply-submit:hover {
    opacity: .9;
}

.reply-submit:active {
    transform: scale(.97);
}

/* ------------------------------ 归档页头部 ------------------------------ */

.archive-header {
    padding: 18px 16px 10px;
}

.archive-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .3px;
}

.archive-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ------------------------------ 时间轴归档 ------------------------------ */

.archive-views {
    padding: 4px 8px 0;
}

.archive-view {
    display: none;
}

.archive-view.active {
    display: block;
}

.moments-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.moments-year {
    margin: 12px 6px 4px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .5px;
}

.moments-group {
    display: flex;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.moments-group:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .07);
}

.moments-date {
    flex: 0 0 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2px;
    border-right: 1px solid var(--divider);
    padding-right: 8px;
}

.mg-day {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.mg-month {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

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

.moment-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.moment-preview {
    margin: 0;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.moment-preview:hover {
    color: var(--accent);
}

/* ------------------------------ 空态 / 404 ------------------------------ */

.empty-tip {
    padding: 40px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-tertiary);
}

.not-found {
    padding: 60px 24px;
    text-align: center;
}

.nf-code {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-tertiary);
    line-height: 1.1;
}

.nf-text {
    margin: 12px 0 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.nf-home {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
}

/* ------------------------------ 分页（隐藏，供滚动加载） ------------------------------ */

.pagination {
    display: none;
}

/* ------------------------------ 回到顶部 ------------------------------ */

#backToTop {
    position: fixed;
    right: 18px;
    bottom: 26px;
    z-index: 90;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    color: var(--text-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

#backToTop:hover {
    color: var(--accent);
}

@media (min-width: 600px) {
    #backToTop {
        right: calc(50% - 288px + 6px);
    }
}

/* ------------------------------ 弹窗通用 ------------------------------ */

.setting-modal,
.links-modal,
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--mask);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.setting-modal.active,
.links-modal.active,
.login-modal.active {
    opacity: 1;
    visibility: visible;
}

.setting-container,
.links-container,
.login-container {
    width: 100%;
    max-width: 400px;
    max-height: 82vh;
    overflow-y: auto;
    border-radius: 14px;
    background: var(--modal-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    transform: translateY(8px) scale(.98);
    transition: transform .24s cubic-bezier(.2, .8, .3, 1);
}

.setting-modal.active .setting-container,
.links-modal.active .links-container,
.login-modal.active .login-container {
    transform: none;
}

.setting-modal-header,
.links-modal-header,
.login-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--divider);
    position: sticky;
    top: 0;
    background: var(--modal-bg);
    z-index: 2;
}

.setting-modal-title,
.links-modal-title,
.login-modal-title {
    font-size: 15px;
    font-weight: 600;
}

.setting-modal-close,
.links-modal-close,
.login-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: var(--text-tertiary);
}

.setting-modal-close:hover,
.links-modal-close:hover,
.login-modal-close:hover {
    background: var(--divider);
    color: var(--text);
}

/* ------------------------------ 设置弹窗内容 ------------------------------ */

.setting-section {
    padding: 14px 16px 4px;
}

.setting-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--divider);
    border-radius: 8px;
    padding: 6px 8px;
}

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

.search-submit {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 6px;
}

.search-submit:hover {
    color: var(--accent);
}

.setting-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.setting-tags .tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    background: var(--divider);
    color: var(--text-secondary);
    transition: color .2s ease, background-color .2s ease;
}

.setting-tags .tag:hover {
    color: var(--accent);
    background: rgba(87, 107, 149, .12);
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--divider);
    font-size: 14px;
    color: var(--text);
}

.mode-toggle:hover {
    background: rgba(127, 127, 127, .16);
}

.mode-icon-light,
.mode-icon-dark {
    display: inline-flex;
    align-items: center;
}

html.dark .mode-icon-light {
    display: none;
}

html:not(.dark) .mode-icon-dark {
    display: none;
}

.mode-text {
    color: var(--text-secondary);
    font-size: 13px;
}

.copyright {
    padding: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--divider);
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-tertiary);
    text-align: center;
}

.copyright a {
    color: var(--text-tertiary);
}

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

/* ------------------------------ 友链弹窗 ------------------------------ */

.links-section {
    padding: 12px 12px 16px;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--divider);
    color: var(--text);
    transition: transform .18s ease, background-color .2s ease;
}

.link-item:hover {
    transform: translateY(-1px);
    background: rgba(127, 127, 127, .13);
}

.link-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
}

.link-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.link-info {
    flex: 1 1 auto;
    min-width: 0;
}

.link-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-description {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    flex: 0 0 auto;
    color: var(--text-tertiary);
}

.links-empty {
    padding: 32px 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ------------------------------ 登录弹窗 ------------------------------ */

.login-form {
    padding: 16px;
}

.login-form-group {
    margin-bottom: 12px;
}

.login-form-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.login-form-input {
    width: 100%;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--divider);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    outline: none;
    transition: border-color .2s ease, background-color .2s ease;
}

.login-form-input:focus {
    border-color: var(--accent);
    background: var(--card-bg);
}

.login-form-remember {
    margin: 4px 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.login-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.login-submit-btn {
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    transition: opacity .2s ease, transform .2s ease;
}

.login-submit-btn:hover {
    opacity: .92;
}

.login-submit-btn:active {
    transform: scale(.99);
}

.login-logged {
    padding: 20px 16px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-logged-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.login-btn-ghost {
    flex: 1 1 0;
    padding: 10px;
    border-radius: 8px;
    background: var(--divider);
    color: var(--text);
    text-align: center;
    font-size: 14px;
}

.login-btn-ghost:hover {
    background: rgba(127, 127, 127, .16);
}

/* ------------------------------ 图片查看器 ------------------------------ */

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: fade-in .2s ease both;
}

.image-viewer[hidden] {
    display: none !important;
}

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

.viewer-image {
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    transition: transform .18s ease;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.viewer-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    z-index: 3;
}

.viewer-prev,
.viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 60px;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    background: rgba(255, 255, 255, .08);
    border-radius: 8px;
    z-index: 3;
}

.viewer-prev {
    left: 10px;
}

.viewer-next {
    right: 10px;
}

.viewer-toolbar {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    z-index: 3;
}

.viewer-toolbar button {
    width: 38px;
    height: 32px;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    background: rgba(255, 255, 255, .06);
}

.viewer-toolbar button:hover {
    background: rgba(255, 255, 255, .2);
}

.viewer-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, .8);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    z-index: 3;
}

/* ------------------------------ 独立页 / 发布 ------------------------------ */

.page-detail {
    flex-direction: column;
    display: block;
    margin: 8px;
}

.page-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
}

.page-content {
    font-size: 15px;
    line-height: 1.7;
    word-break: break-word;
}

.page-content img {
    border-radius: 6px;
}

.page-comment-tip {
    margin-top: 18px;
    font-size: 13px;
}

.post-detail {
    padding: 8px;
}

.compose-container {
    margin: 8px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.compose-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.compose-field {
    margin-bottom: 12px;
}

.compose-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.compose-input,
.compose-textarea {
    width: 100%;
    font: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--divider);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    outline: none;
    transition: border-color .2s ease, background-color .2s ease;
}

.compose-textarea {
    min-height: 160px;
    resize: vertical;
}

.compose-input:focus,
.compose-textarea:focus {
    border-color: var(--accent);
    background: var(--card-bg);
}

.compose-row {
    display: flex;
    gap: 8px;
}

.compose-row > .compose-field {
    flex: 1 1 0;
    min-width: 0;
}

.compose-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.compose-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.compose-submit {
    padding: 10px 22px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
}

.compose-submit:hover {
    opacity: .92;
}

.compose-tip {
    font-size: 12px;
    color: var(--text-tertiary);
}

.compose-message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
}

.compose-message.error {
    background: rgba(226, 74, 74, .1);
    color: #d24545;
}

.compose-message.success {
    background: rgba(58, 166, 104, .1);
    color: #2f9257;
}

/* ------------------------------ 小游戏页 ------------------------------ */

.game-container {
    margin: 8px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.game-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.game-score {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.game-score strong {
    color: var(--accent);
    font-size: 16px;
}

.game-canvas-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--divider);
    line-height: 0;
    touch-action: manipulation;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    text-align: center;
    padding: 16px;
    line-height: 1.5;
}

.game-overlay h2 {
    margin: 0;
    font-size: 20px;
}

.game-overlay p {
    margin: 0;
    font-size: 13px;
    opacity: .85;
}

.game-button {
    padding: 9px 24px;
    border-radius: 999px;
    background: #fff;
    color: #1b1b1b;
    font-size: 14px;
    font-weight: 600;
}

.game-controls {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.game-control {
    flex: 1 1 0;
    min-width: 64px;
    padding: 10px;
    border-radius: 8px;
    background: var(--divider);
    font-size: 14px;
    color: var(--text);
}

.game-control:active {
    background: rgba(127, 127, 127, .2);
}

.game-help {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* ------------------------------ 加载提示 ------------------------------ */

.scrollload-loading,
.scrollload-nomore,
.scrollload-error {
    padding: 18px 16px 26px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

.scrollload-error a {
    color: var(--accent);
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 380px) {
    .post-images.grid-three {
        gap: 3px;
    }

    .post-content {
        font-size: 14.5px;
    }

    .header-info {
        bottom: 10px;
        padding: 0 14px;
    }

    .header-avatar-link {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }
}

@media (min-width: 577px) {
    body {
        background: var(--bg);
    }

    main {
        box-shadow: 0 0 0 1px var(--border);
        background: var(--bg);
    }
}
