/* Lightweight shared polish for CMS category, article, tag, event and special pages. */
html { scroll-behavior: smooth; }
body {
    color: #30343b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }

.fm-index-main, .show, .showmain, .column, .main, .ivspecial,
.fm-show, .show-left, .column-main, .column-aside {
    box-sizing: border-box;
    min-width: 0;
}
.fm-index-main a, .show a, .showmain a, .column a {
    transition: color 150ms ease, opacity 150ms ease;
}
.fm-index-main a:hover, .show a:hover, .showmain a:hover, .column a:hover { color: #c92d36; }
.fm-index-main a:focus-visible, .show a:focus-visible,
.showmain a:focus-visible, .column a:focus-visible {
    outline: 2px solid #c92d36;
    outline-offset: 2px;
}

/* Responsive image constraints without changing CMS-generated URLs or markup. */
.news-list img, .huizhanlist img, .special img, .blog-list img,
.columnpage img, .text img, .fm-show img {
    max-width: 100%;
}
.news-list img, .huizhanlist img, .blog-list img, .columnpage img { object-fit: cover; }
.text img { height: auto !important; }
.text table { max-width: 100%; }
.text pre, .text code { white-space: pre-wrap; overflow-wrap: anywhere; }
.text video, .text iframe { max-width: 100%; }

/* Article/event detail pages: fill the available content column instead of
   carrying the legacy 730px fixed width into wider desktop layouts. */
.show-left { min-width: 0; }
.show-left .fm-show {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}
.backtotop { height: auto; }
.backtotop .totop { display: none !important; }
.backtotop .erweima, .backtotop .fave_b { float: none; }
.backtotop .fave_b { margin-bottom: 0; }

/* The columnist page has a legacy footer script that can pin short pages. */
body.column-page footer {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
}
body.column-page .backtotop #totop { display: none !important; }
body.column-page .num-box {
    display: flex;
    align-items: stretch;
    gap: 12px;
}
body.column-page .article,
body.column-page .moods {
    float: none;
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    border: 0;
    text-align: left;
    line-height: 1.5;
}
body.column-page .article p,
body.column-page .moods p { margin: 0; }
body.column-page .article b:not(.b),
body.column-page .moods b:not(.b) {
    display: inline-block;
    margin-left: 6px;
    color: #202a35;
    font-size: 18px;
    font-weight: 700;
}
body.column-page .subscription-feedback {
    display: inline-block;
    margin: 8px 0 0 10px;
    color: #64748b;
    font-size: 13px;
    vertical-align: middle;
}
body.column-page #a_dingyue a.add.is-loading {
    opacity: .65;
    pointer-events: none;
}
body.column-page .rec-column .m-main { margin: 18px 14px 30px; }
body.column-page .column-aside .rec-column .m-main ul {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
}
body.column-page .column-aside .rec-column .m-main li {
    display: block !important;
    float: left !important;
    width: 70px !important;
    min-width: 0;
    margin: 13px 10px 0;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
}
body.column-page .rec-column li img {
    display: block;
    width: 68px;
    height: 68px;
    max-width: 100%;
    margin: 0 auto 6px;
    border-radius: 50%;
    object-fit: cover;
}
body.column-page .rec-column li p {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.column-page .followcon p {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    justify-content: center;
    column-gap: 10px;
    margin: 12px 0 0;
    padding: 0 8px;
}
body.column-page .followcon p img {
    display: block;
    width: 100% !important;
    max-width: 108px !important;
    height: auto;
    margin: 0;
    justify-self: center;
    box-sizing: border-box;
    object-fit: contain;
}
body.column-page .rec-column .m-main:after {
    display: block;
    clear: both;
    content: "";
}

/* Keep filters and ordering usable on narrow screens. */
.shaixuan, .shaixuan .field, .order, .order ul, .haolistpages {
    box-sizing: border-box;
    max-width: 100%;
}
.shaixuan .field, .order ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.shaixuan .field a, .order li { max-width: 100%; }
.haolistpages { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Event cards: crop unusually tall source images inside a responsive thumbnail
   frame so they cannot overlap the title or event details. */
body.event-list-page .fm-index-main .in-news .news-list .huizhanlist li .pad .img {
    position: relative;
    display: block;
    width: 100%;
    height: auto !important;
    max-height: 220px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    transform: none !important;
}
body.event-list-page .fm-index-main .in-news .news-list .huizhanlist li .pad .img img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
}
body.event-list-page .fm-index-main .in-news .news-list .huizhanlist li .pad .info {
    position: relative;
    z-index: 1;
    min-width: 0;
    padding-top: 15px !important;
    overflow-wrap: anywhere;
}
body.event-list-page .huizhanlist .info .title {
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* Columnist and tag index grids collapse cleanly instead of overflowing. */
.column { width: 100%; max-width: 1200px; margin-right: auto; margin-left: auto; }
.column-aside, .column-main { min-width: 0; }
.profile img, .rec-column img, .followcon img { max-width: 100%; height: auto; }
.summary, .blog-list, .leter-search { overflow-wrap: anywhere; }
#masonry {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
}
#masonry > li { min-width: 0; margin: 0; }

@media (max-width: 900px) {
    .column { padding-right: 16px; padding-left: 16px; }
    .column-aside, .column-main { float: none !important; width: 100% !important; }
}
@media (min-width: 768px) and (max-width: 1279px) {
    .show .show-left { float: none; width: 100% !important; margin: 0 auto; }
    .show-left .fm-show { padding-right: 32px; padding-left: 32px; }
}
@media (min-width: 1280px) {
    .show-left .fm-show { padding-right: 42px; padding-left: 42px; }
}
@media (max-width: 640px) {
    html { scroll-behavior: auto; }
    .fm-index-main, .show, .showmain, .main, .ivspecial { max-width: 100%; }
    .column { padding-right: 12px; padding-left: 12px; }
    #masonry { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .fm-show, .text, .pinglun { max-width: 100%; }
    .show-left .fm-show { padding: 20px 16px; }
    .text { overflow-wrap: anywhere; }
    .text table { display: block; overflow-x: auto; }
    body.column-page .rec-column li img { width: 58px; height: 58px; }
    body.event-list-page .fm-index-main { width: 100%; max-width: 100%; padding-right: 12px; padding-left: 12px; }
    body.event-list-page .huizhanlist { width: 100%; }
    body.event-list-page .fm-index-main .in-news .news-list .huizhanlist > li {
        float: none;
        width: 100% !important;
        height: auto !important;
        margin: 0 0 14px;
        box-sizing: border-box;
    }
    body.event-list-page .huizhanlist > li > .pad { padding: 12px; }
    body.event-list-page .fm-index-main .in-news .news-list .huizhanlist li .pad .img {
        max-height: 190px;
        aspect-ratio: 16 / 9;
    }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .fm-index-main a, .show a, .showmain a, .column a { transition: none; }
}
