/* 重置样式 (Reset Styles) */
* {
    box-sizing: border-box;
}

/* 基础样式 (Base Styles) */
html { background: #eeeeec; }
body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", "WenQuanYi Micro Hei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333333;
    background: url(../img/background.png) repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 文章内容样式 */
.article-content {
    font-size: 16px;
    line-height: 1.8;
}

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

/* 布局样式 (Layout Styles) */

/* 头部区域 (Header) */
#header-bg {
    width: 100%;
    background:url(../img/header-bg.png) repeat-x top;
    margin: 0;
    padding: 0;
    border: 0;
}

/* 头部容器 */
.header-container {
    max-width: 1280px;
    width: 100%;
    height: 330px;
    margin: 0 auto;
    padding: 0 10px;
    border: 0;
    background: none;
    overflow: hidden;
    box-sizing: border-box;
}

/* 头部顶部区域 */
.header-top {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-justify-content: space-between;
    -moz-justify-content: space-between;
    -ms-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    margin: 70px 0 15px 0 !important;
}

/* LOGO样式 */
.logo {
    margin: 0 auto;
    width: 416px;
    height: 140px;
}

.logo img {
    width: 416px;
    height: 140px;
    display: block;
}

/* 登录状态样式 */
.login-status {
    color: #000000;
    font-size: 14px;
}

.login-status a {
    color: #000000;
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.3s ease;
}

.login-status a:hover {
    color: #cc0000;
    text-decoration: underline;
}

/* 头部导航区域 */
.header-nav {
    clear: both;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

/* 主体内容区域 (Body) */
#body {
    padding: 10px 0 20px 0;
}

/* 容器样式 */
.container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    background-color: transparent;
    border: none;
    box-sizing: border-box;
}

/* 新增容器样式：白色背景，10px内边距，10px底部外边距 */
.new-container {
    background-color: white;
    padding: 10px;
    margin-bottom: 10px;
}

/* 面包屑导航容器样式：无背景，无内边距，无边框，高度自动 */
.breadcrumb-container,
.new-container.breadcrumb-container {
    background: none;
    padding: 0;
    margin-top: 0;
}

/* 面包屑导航样式：无背景，无内边距，无边框 */
.breadcrumb {
    background: none;
    padding: 0 10px;
    margin: 0;
}

/* 写文章页面包屑：与栏目列表页保持一致（字号 15.68px、#333、透明底、左右 10px、下间距 10px） */
.home-content-post .breadcrumb-container {
    margin: 0 0 10px;
    padding: 0;
    background: none;
}

.home-content-post .breadcrumb-container .breadcrumb {
    font-size: 0.98rem;
    line-height: 1.6;
    color: #333333;
    background: none;
    padding: 0 10px;
    margin: 0;
}

/* 主体内容外层容器样式：白色背景，10px内边距 */
.main-wrapper {
    background-color: white;
    padding: 10px;
    margin: 0 0 1rem 0;
    box-sizing: border-box;
}

/* 主体内容容器样式：无背景、边框、内外边距 */
.main-container {
    background: none;
    border: 1px solid #DDDDDD;
    border-top: 2px solid #D01F3F;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* 行容器样式 */
.row {
    width: 100%;
    background-color: #fff;
    padding: 10px;
    border: none;
    margin: 0 0 1rem 0;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    margin-bottom: 0;
}

/* 首页行容器样式 */
.row.mb-4,
.row.mb-4.row-full {
    width: 100%;
    background-color: #fff;
    padding: 10px;
    border: none;
    margin: 0 0 10px 0 !important;
    box-sizing: border-box;
    display: grid;
    grid-gap: 10px;
    align-items: start;
}

/* 行容器与主体容器组合样式 - 解决样式冲突 */
.row.main-container {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: block;
}

/* 确保主体内容列容器没有内边距 */
.row.main-container .col-lg-12.main {
    padding: 0;
    margin: 0;
}

/* 确保面包屑导航没有额外的内边距或外边距 */
.row.main-container .breadcrumb {
    margin: 0 0 1rem 0;
}

/* 行布局变体 */
.row.row-full {
    grid-template-columns: 100%;
    grid-gap: 0;
}

/* 60/40 双块行：首行（幻灯片+最新文章）
   行本身不再铺白底，两个子区块各自独立成块，中间留 10px 页面空白 */
.row.mb-4.row-split {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-gap: 10px;
    padding: 0;
    background-color: transparent;
    align-items: stretch;
}

/* 50/50 双块行：练功心得 + 太极养生，网格 10px 间隔，不溢出容器 */
.row.mb-4.row-halves {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-gap: 10px;
    padding: 0;
    background-color: transparent;
    align-items: stretch;
}

.row.row-split > *,
.row.row-halves > * {
    min-width: 0;
    box-sizing: border-box;
}

/* 两个半宽容器等高时，网格内容保持顶部紧凑排列，避免行高被拉伸 */
.row.mb-4.row-halves > .zg-shell > .grid-container {
    align-content: start;
}

/* 双层结构：外层白壳（白底 + 10px 内边距），内层放带边框的容器 */
.zg-shell {
    background-color: #fff;
    padding: 10px;
    box-sizing: border-box;
}

/* 幻灯片无数据时的占位图 */
.zg-slide-placeholder {
    background-color: #F7F7F7;
}

.zg-slide-placeholder img {
    display: block;
    width: 100%;
    height: auto;
}

/* 首页列容器样式：保留 1px 浅灰边框，但去掉内边距避免与外层白壳形成双层白框 */
.col-left {
    border: 1px solid #EEEEEE;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.col-right {
    border: 1px solid #EEEEEE;
    border-top: 3px solid #FF6633;
    overflow: hidden;
    padding: 15px;
    box-sizing: border-box;
}

/* 侧边栏内容转为横向显示的grid布局 */
.grid-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 10px;
}

/* 页脚区域 (Footer) */
#footer {
    width: 100%;
    background-color: transparent;
    background-image:url(../img/footer.png);
    background-position:center bottom;
    background-repeat:no-repeat;
    border-top:none;
    padding: 20px 0 60px;
    color: #fff;
    border: none !important;
    /* 以页脚自身宽度作为窄屏断点基准，避免视口媒体查询 */
    container-type: inline-size;
    container-name: zgfooter;
}

/* 页脚内部容器样式 - 最大宽度 1280px，居中并留左右内边距 */
#footer .wp {
    width: 100%;
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 10px !important;
    box-sizing: border-box;
    height: 60px;
}

/* 页脚行容器样式 - 覆盖通用row样式 */
#footer .row,
#footer .row.no-gutters {
    background: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    border: none;
    grid-template-columns: none;
    grid-gap: 0;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

/* 页脚列容器样式 - 确保透明背景 */
#footer .footer-left,
#footer .footer-right,
#footer .col-12,
#footer .col-md-8,
#footer .col-md-4 {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    grid-template-columns: none;
    grid-gap: 0;
}

#footer .footer-left,
#footer .footer-right {
    background: none !important;
    border: none !important;
    padding: 10px 5px !important;
    margin: 0 !important;
}

/* 备案信息样式 */
#footer .icp, #footer .police {
    margin-top: 10px;
    color: #fff;
    font-size: 12px;
}

#footer .police img {
    vertical-align: middle;
    margin-right: 5px;
}

/* 窄屏（≤767px）：页脚左右信息改为上下两行居中，避免被挤压变形 */
@container zgfooter (max-width: 767.98px) {
    #footer .wp {
        height: auto !important;
        min-height: 60px;
    }

    #footer .row,
    #footer .row.no-gutters {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        row-gap: 2px;
    }

    #footer .footer-left,
    #footer .footer-right,
    #footer .col-12,
    #footer .col-md-8,
    #footer .col-md-4 {
        width: 100%;
        text-align: center !important;
    }

    #footer .footer-left,
    #footer .footer-right {
        padding: 1px 5px !important;
    }
}

/* 特殊页面样式 (Special Page Styles) */

/* tag、tag_list、home_content_post页面通用样式 */
body.tag .main .row:not(ul.row),
body.tag-list .main .row:not(ul.row) {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

body.home-content-post .main .row:not(ul.row) {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
}

/* 确保面包屑导航独占一行且样式一致 */
body.tag .main .d-flex,
body.tag-list .main .d-flex,
body.home-content-post .main .d-flex {
    width: 100%;
    margin: 0 0 10px 0;
}

/* 确保card-threadlist独占一行 */
body.tag .main .card-threadlist,
body.tag-list .main .card-threadlist {
    width: 100%;
    margin-bottom: 15px;
}

/* tag和tag_list页面main容器样式，确保与导航宽度一致 */
body.tag .main,
body.tag-list .main {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto !important;
    padding: 0 10px !important;
    box-sizing: border-box;
}

/* 修复tag页面中main容器的宽度 */
body.tag .col-lg-9.mx-auto.main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 修复容器宽度限制，与其他页面保持一致 */
body.tag .container,
body.tag .container-fluid {
    width: 100% !important;
    max-width: 1280px !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

/* tag页面card容器外层包裹样式 */
body.tag .tag-card-wrapper {
    background: white !important;
    padding: 10px !important;
    border-radius: 0 !important;
    margin: 0 0 15px 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    overflow: hidden !important;
}

/* tag页面card-body容器样式 - 无外边距 */
body.tag .card-body {
    margin: 0 !important;
    padding: 0px !important;
}

/* 检查并调整tag页面中的card和card-threadlist样式 */
body.tag .card,
body.tag .card-threadlist {
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #ddd !important;
    border-radius: 0 !important;
}

/* 确保tag页面中的row和col容器在960px宽度内 */
body.tag .row {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body.tag .col-md-12,
body.tag .col-lg-9.mx-auto {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* tag_list页面样式 */
body.tag-list .col-lg-12.main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
}

/* tag_list页面卡片样式修复 - 使用grid布局 */
.content.tag-list-content {
    max-width: 1280px !important;
    width: 100% !important;
    margin: 0 auto !important;
    background-color: white !important;
    box-sizing: border-box !important;
    display: block !important;
    border: none !important;
}

/* 标签列表样式 - 改为grid布局 */
.content.tag-list-content ul.row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-gap: 10px !important;
    margin: 0 !important;
    padding: 10px !important;
    list-style: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 标签项样式 - 重置grid布局下的样式 */
.content.tag-list-content ul.row > li {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: block !important;
    flex-direction: row !important;
}

/* 卡片样式 - 降低高度 */
.content.tag-list-content ul.row > li .card {
    width: 100% !important;
    min-height: 60px !important;
    height: 60px !important;
    margin: 0 !important;
    padding: 20px !important;
    border: 1px solid #e9ecef !important;
    border-radius: 0.25rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: center !important;
}

/* 卡片内容样式 - 重置高度和布局 */
.content.tag-list-content ul.row > li .card-body {
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
}

/* 卡片内部列表样式 - 重置flex布局 */
.content.tag-list-content ul.row > li .card-body > ul {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 卡片标题样式 - 调整字体大小 */
.content.tag-list-content ul.row > li .card-body h2.h6 {
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
}

/* 文章数量样式 - 保持不变 */
.content.tag-list-content ul.row > li .card-body li:last-child {
    font-size: 14px !important;
    color: #666 !important;
}

/* 写文章页面新增容器样式 */
body.home-content-post .post-top-container {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 10px;
}

body.home-content-post .post-top-container .post-top-left,
body.home-content-post .post-top-container .post-top-right {
    background: white;
    padding: 10px;
    margin: 0;
}

body.home-content-post .post-top-container .post-top-inner {
    border: 1px solid #EEEEEE;
    padding: 10px;
}

/* 登录和注册页面样式 */
body.user-login .container-fluid,
body.user-create .container-fluid,
body.user-resetpw .container-fluid,
body.user-resetpw_complete .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.login-card-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

.login-card-wrapper {
    background-color: white;
    padding: 10px;
}

body.user-login .card,
body.user-create .card,
body.user-resetpw .card,
body.user-resetpw_complete .card {
    border-radius: 0;
    width: 100%;
    max-width: none;
}

/* 修复登录和注册页面输入框和图标高度不一致问题 */
.login-card-container .input-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: stretch;
}

.login-card-container .input-group .form-control {
    height: 40px !important;
    padding: 0 12px;
    border-radius: 0 4px 4px 0;
    margin-left: -1px;
    border-left: 1px solid #ddd;
    border-color: #ddd;
    font-size: 14px;
    flex: 1;
}

.login-card-container .input-group-text {
    padding: 0 10px;
    border-color: #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    height: 40px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-container .input-group-prepend {
    display: flex;
    align-items: center;
    height: 40px;
}

/* 统一个人中心表单输入框与前置图标高度（my-password 等） */
.zg-my-form .input-group {
    display: flex;
    align-items: stretch;
}

.zg-my-form .input-group .form-control {
    height: 40px;
    line-height: 38px;
    padding: 0 12px;
}

.zg-my-form .input-group-text {
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zg-my-form .input-group-prepend {
    display: flex;
    align-items: center;
    height: 40px;
}

/* 评论相关样式 */
/* 评论列表和评论表单行样式 - 覆盖默认grid布局 */
.postlist li.row {
    display: block;
    grid-template-columns: none;
    grid-gap: 0;
    padding: 10px 0;
    margin: 0;
    background-color: transparent;
    border-bottom: 1px solid #EEEEEE;
}

/* 评论回复表单样式 - 无底部边框 */
li.row.post.newpost.media {
    display: block;
    grid-template-columns: none;
    grid-gap: 0;
    padding: 20px 0 0 0;
    margin: 0;
    background-color: transparent;
    border: none;
}

/* 评论回复表单消息框间距 */
li.row.post.newpost.media .message {
    margin-top: 1rem !important;
}

/* 组件样式 (Component Styles) */

/* 卡片组件基础样式 */
.card-header {
    background-color: #F2F2F2 !important;
}

/* 移除卡片的圆角效果 */
.card,
.card.card-thread,
.card.card-postlist {
    border-radius: 0 !important;
}

/* 导航栏组件 */
.navbar {
    background-color: #cc0000 !important;
    padding: 0;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

/* 确保导航行占据整个宽度 */
.nav-first-row,
.nav-second-row {
    width: 100%;
}

.nav-first-row {
    height: 50px;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    width: 100%;
}

/* 导航第二行样式 */
.nav-second-row {
    height: auto;
    background-color: #ffffff;
    border: 1px solid #DCDCDC;
    border-bottom: 1px solid #DCDCDC;
    padding: 10px;
    box-sizing: border-box;
}

/* 导航第二行内部嵌套容器 - 左右两列布局 */
.nav-second-row-inner {
    display: -webkit-grid;
    display: -moz-grid;
    display: -ms-grid;
    display: grid;
    -webkit-grid-template-columns: 1fr auto;
    -moz-grid-template-columns: 1fr auto;
    -ms-grid-template-columns: 1fr auto;
    grid-template-columns: 1fr auto;
    gap: 20px;
    -webkit-gap: 20px;
    -moz-gap: 20px;
    -ms-gap: 20px;
    width: 100%;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
}

/* 左列：搜索框 */
.nav-second-row-left {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-justify-content: flex-start;
    -moz-justify-content: flex-start;
    -ms-justify-content: flex-start;
    justify-content: flex-start;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
}

/* 右列：登录状态 */
.nav-second-row-right {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-justify-content: flex-end;
    -moz-justify-content: flex-end;
    -ms-justify-content: flex-end;
    justify-content: flex-end;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: bold;
    font-size: 20px;
    padding: 10px 0px;
}

#nav .nav-item {
    margin: 0;
}

#nav .nav-link {
    color: #ffffff !important;
    font-size: 16px;
    padding: 10px 20px !important;
    line-height: 30px;
    height: 50px;
    box-sizing: border-box;
}

#nav .nav-link:hover,
#nav .nav-item.active .nav-link {
    color: #ffea00 !important;
    background-color: #dd2222;
    transition: all 0.3s ease;
}

.navbar-light .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 搜索组件 */
.nav-second-row .form-inline {
    margin-left: 0;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    height: 100%;
    margin-top: 0;
    margin-bottom: 0;
}

/* 确保搜索框和按钮在表单中垂直对齐 */
.nav-second-row .form-inline .form-control,
.nav-second-row .form-inline .btn {
    vertical-align: middle;
    margin: 0;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    -moz-justify-content: center;
    -ms-justify-content: center;
    justify-content: center;
}

.form-control {
    border-color: #ddd;
    border-radius: 4px;
    height: 30px;
    padding: 0 10px;
    font-size: 14px;
}

/* 去除搜索框焦点样式 */
.form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: #ddd;
}

/* 按钮组件 */
.btn-outline-success,
.btn-primary {
    color: #000000;
    border-color: #F1D299;
    height: 30px;
    padding: 0 15px;
    font-size: 14px;
    line-height: 1.2;
    background-color: #FAF1D5;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    -moz-justify-content: center;
    -ms-justify-content: center;
    justify-content: center;
}

.btn-primary {
    background-color: #cc0000;
    color: #fff;
    border-color: #cc0000;
}

.btn-outline-success:hover {
    color: #000000;
    background-color: #faea00;
    border-color: #faea00;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #dd2222;
    border-color: #dd2222;
    transition: all 0.3s ease;
}

/* 表格组件 */
.table {
    background-color: #fff;
}

.table th,
.table td {
    border-color: #eaeaea;
    padding: 12px 8px;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom-width: 2px;
    border-bottom-color: #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 版块信息组件 */
.forum-info-inner {
    border: 1px solid #EEEEEE;
    border-top: 2px solid #D01F3F;
}

/* 版块统计信息的grid布局 */
.forum-stats-grid {
    display: grid;
    grid-template-columns: auto repeat(3, 1fr); /* 版块名称 + 3 统计项 */
    gap: 10px;
    align-items: left;
    font-size: 14px; /* 统一字体大小 */
    border-bottom: 1px solid #eeeeee;
    padding: 10px;
}

/* 版块名称样式 */
.forum-stats-grid h5 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

/* 统计项样式 */
.stat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 版块简介样式 */
.forum-brief {
    text-align: left;
    padding: 10px;
}

/* 卡片组件变体 */
/* 写文章页面卡片样式 */
.home-content-post .card,.home-content-post .card-body {
    background: none;
    border: none;
    box-sizing: border-box;
    padding: 0;
}

/* 写文章页：仅最外层布局行使用 flex 两栏，内部行保持 Bootstrap 默认 */
.home-content-post form > .row {
    background: none;
    border: none;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.home-content-post .post-row-left {
    background: white;
    padding: 10px;
    box-sizing: border-box;
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

.home-content-post .post-row-right {
    background: white;
    padding: 10px;
    box-sizing: border-box;
    margin: 0;
    flex: 0 0 230px;
    width: 230px;
}

/* 写文章页窄屏：正文与右栏改为上下堆叠（容器查询替代视口媒体查询） */
@container zgpage (max-width: 959.98px) {
    .home-content-post .post-row-left {
        flex: 1 1 100%;
    }

    .home-content-post .post-row-right {
        flex: 1 1 100%;
        width: auto;
    }

    /* 窄屏：右侧栏改为正文下方分组手风琴，取消浮动按钮与吸顶 */
    .home-content-post .post-sticky-top {
        position: static !important;
    }

    .home-content-post .button-show,
    .home-content-post .button-hide {
        display: none !important;
    }

    .home-content-post .post-settings-title {
        margin: 0 0 8px;
        padding: 9px 10px;
        background: #F2F2F2;
        color: #333333;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
    }
}

/* 写文章页右侧折叠面板标题 */
#accordionthread .nav-link.alert-primary {
    background-color: #F2F2F2;
    color: #333333 !important;
    border-radius: 0;
    font-weight: 600;
    padding: 8px 10px !important;
    height: auto !important;
    line-height: 1.4;
}

#accordionthread .nav-link.alert-primary:hover {
    background-color: #E9E9E9;
    color: #CC0000 !important;
}

/* card-site-info外部嵌套容器样式 */
.card-site-info-wrapper {
    background-color: white;
    padding: 10px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.card-site-info {
    background-color: white;
    border: 1px solid #eeeeee;
    border-radius: 0.25rem;
    overflow: hidden;
}

.grid-sidebar .flag-item {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    overflow: hidden;
}

/* 文章信息组件 */
.article-info {
    padding: 10px 15px;
    background-color: #f8f9fa;
    margin-bottom: 20px;
}

.article-info .author, 
.article-info .date, 
.article-info .views, 
.article-info .replies {
    margin-right: 15px;
    color: #666;
    font-size: 14px;
}

/* 评论组件 */
.comment-item {
    background-color: #f9f9fa;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.comment-item:hover {
    background-color: #f5f5f5;
}

.comment-header {
    font-weight: bold;
    margin-bottom: 8px;
    margin-bottom: 10px;
    font-weight: bold;
}

.comment-author {
    color: #333;
}

.comment-date {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

.comment-content {
    line-height: 1.6;
}

/* 分页组件 */
.pagination {
    margin: 20px 0;
    text-align: center;
}

/* 新分页容器中的分页控件样式调整 */
.new-pagination-container .pagination {
    margin: 0;
    text-align: left;
}

.pagination a:hover {
    background-color: #f8f9fa;
    border-color: #ccc;
}

.pagination .current {
    background-color: #cc0000;
    border-color: #cc0000;
    color: #fff;
}

/* 新增分页容器样式 */
.new-pagination-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    background-color: white;
    border: none;
    margin-bottom: 10px;
    padding: 0px 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* 分页容器内部两列grid布局 */
.pagination-grid {
    display: -webkit-grid;
    display: -moz-grid;
    display: -ms-grid;
    display: grid;
    -webkit-grid-template-columns: 50% 50%;
    -moz-grid-template-columns: 50% 50%;
    -ms-grid-template-columns: 50% 50%;
    grid-template-columns: 50% 50%;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    width: 100%;
}

/* 各列内容对齐样式 */
.pagination-grid .column-1 {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-justify-content: flex-start;
    -moz-justify-content: flex-start;
    -ms-justify-content: flex-start;
    justify-content: flex-start;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    height: 100%;
}

.pagination-grid .column-2 {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-justify-content: flex-end;
    -moz-justify-content: flex-end;
    -ms-justify-content: flex-end;
    justify-content: flex-end;
    -webkit-align-items: center;
    -moz-align-items: center;
    -ms-align-items: center;
    align-items: center;
    height: 100%;
}

/* 分页控件焦点样式 */
.pagination a:focus, 
.pagination span:focus {
    background-color: #EF473A;
    border-color: #EF473A;
    color: #fff;
}

/* 窄屏下工具栏与分页上下排列，避免按钮被挤压换行（容器查询） */
@container zgpage (max-width: 739.98px) {
    .pagination-grid {
        grid-template-columns: 100%;
    }

    .pagination-grid .column-2 {
        justify-content: flex-start;
        padding-top: 10px;
    }
}

/* verify 系列页面：工具栏与翻页控件不使用白色外壳，整体居中 */
.new-pagination-container.zg-verify-pager {
    background: transparent;
    padding: 0;
    margin-bottom: 10px;
}

.new-pagination-container.zg-verify-pager .pagination-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 25px;
    width: 100%;
}

.new-pagination-container.zg-verify-pager .pagination-grid .column-1,
.new-pagination-container.zg-verify-pager .pagination-grid .column-2 {
    flex: 0 0 auto;
    justify-content: center;
    padding-top: 0;
}

.new-pagination-container.zg-verify-pager .pagination-grid .column-1 .text-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.new-pagination-container.zg-verify-pager .pagination-grid .mod-button,
.new-pagination-container.zg-verify-pager .pagination-grid nav.my-3 {
    margin: 0 !important;
}

/* 回复表单组件 */
.reply-form {
    padding: 20px;
    background-color: #f8f9fa;
}

.reply-form h3 {
    margin-bottom: 20px;
    color: #333;
}

.reply-form .form-group {
    margin-bottom: 15px;
}

.reply-form textarea {
    resize: vertical;
}

/* 侧边栏组件 */
.sidebar .widget {
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
}

.sidebar .widget h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.sidebar .list-unstyled {
    padding-left: 0;
}

.sidebar .list-unstyled li {
    margin-bottom: 8px;
}

.sidebar .tags a {
    display: inline-block;
    margin: 4px 4px 0 0;
}

/* 线程列表组件 */
.icn img {
    vertical-align: middle;
}

.by {
    white-space: nowrap;
    font-size: 12px;
}

.num em {
    display: block;
    font-size: 12px;
    color: #999;
    font-style: normal;
}

.s.xst {
    font-size: 16px;
    color: #333333;
    text-decoration: none;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.s.xst:hover {
    color: #cc0000;
    text-decoration: underline;
}

/* 首页文章组件 */
.col-right .title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 1px dotted #ccc;
    color: #DD2222;
}

/* 首页文章项样式 */
.article-item {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #eee;
}

/* 首页新增网格容器样式 */
.grid-container {
    display: grid;
    border: 1px solid #EEEEEE;
    border-top: 2px solid #FF0000;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
}

.grid-container .title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #ccc;
    color: #333333;
}

/* 蓝色顶部边框的网格容器 */
.grid-container.blue-top {
    border-top-color: #2E80D1;
}

/* 红色顶部边框的网格容器 */
.grid-container.red-top {
    border-top-color: #FF3333;
}

/* 首页文章分类样式 */
.article-section {
    display: inline-block;
    color: #666;
    font-size: 12px;
}

/* 首页文章标题容器样式 */
.article-title {
    display: inline-block;
    margin: 0 10px;
    font-size: 14px;
}

/* 首页文章标题链接样式 */
.article-title a {
    color: #333;
    text-decoration: none;
}

/* 首页文章时间样式 */
.article-time {
    display: inline-block;
    color: #999;
    font-size: 12px;
}

/* 滚动按钮组件 */
.scroll-to-top, .scroll-to-bottom {
    position: fixed;
    right: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    background-color: rgba(52, 58, 64, 0.8);
    color: #fff;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.scroll-to-top {
    bottom: 80px;
    display: none;
}

.scroll-to-bottom {
    bottom: 20px;
    display: inline;
}

.scroll-to-top:hover, .scroll-to-bottom:hover {
    background-color: #343a40;
    color: #FAEA00;
    text-decoration: none !important;
}

/* 屏幕阅读器组件 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 首页轮播图组件 */
#carouselExampleIndicators {
    width: 100%;
    height: auto;
}

.carousel-item img {
    width: 100%;
    height: 382px;
    object-fit: cover;
    box-sizing: border-box;
}

/* 论坛板块组件 */
/* 已合并到Bootstrap卡片样式中 */

/* 响应式设计 (Responsive Design) */

/* 窄屏适配：基于内容容器宽度（替代视口媒体查询） */
@container zgpage (max-width: 739.98px) {
    .forum-stats-grid {
        grid-template-columns: 1fr; /* 在移动端垂直排列 */
        gap: 10px;
    }
    
    .grid-sidebar {
        grid-template-columns: 1fr;
    }
    
    .carousel-item img {
        height: 232px;
    }
    
    /* 移动端导航优化 */
    #nav {
        margin-top: 10px;
    }
    
    #nav .nav-item {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    /* 移动端表格优化 */
    .table-responsive {
        border: none;
    }
    
    /* 移动端布局优化 */
    .col-md-8, .col-md-4 {
        margin-bottom: 20px;
    }
    
    /* 移动端字体大小调整 */
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    /* 移动端卡片优化 */
    .card {
        margin-bottom: 15px;
    }
    
    /* 移动端轮播图标题隐藏 */
    .carousel-caption {
        display: none;
    }
}

/* 轮播高度已由下方 .carousel-item img 的 aspect-ratio: 3/2 统一接管，
   原先按视口分档设置固定高度的规则已移除 */

/* 控制common.template.htm中的自定义布局 */
.custom-row {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: flex;
    -webkit-justify-content: center;
    -moz-justify-content: center;
    -ms-justify-content: center;
    justify-content: center;
    width: 100%;
    max-width: 1280px;
    margin: 1rem auto 0;
    gap: 10px;
    box-sizing: border-box;
}

.custom-left-content {
    flex: 1;
    max-width: 690px;
    width: 100%;
    background-color: white;
    border: 1px solid #DFDFDF;
    box-sizing: border-box;
}
.custom-left-content .threadlist {
    border-bottom: 1px solid #DFDFDF;
}

/* 列表页带图文章缩略图：固定 180×120，object-fit 保证不变形，窄屏不收缩 */
.threadlist .zg-list-thumb {
    flex: 0 0 180px;
    width: 180px;
    max-width: 180px;
    min-width: 0;
    box-sizing: border-box;
    margin-right: 10px;
}
.threadlist .zg-list-thumb a {
    display: block;
    width: 180px;
}
.threadlist .zg-list-thumb-img {
    display: block;
    width: 180px;
    height: 120px;
    object-fit: cover;
    object-position: center;
}

.custom-right-nav {
    max-width: 260px;
    width: 100%;
    box-sizing: border-box;
    padding-right: 0;
}
/* ============================================================
   响应式增强层（在原主题规则之后追加，不替换原有视觉规则）
   ============================================================ */

/* 内容容器作为容器查询基准；原 padding/max-width 保持不变 */
.container {
    container-type: inline-size;
    container-name: zgpage;
}

/* 头部：桌面 LOGO 416×140 不变，窄屏按比例缩放 */
.header-container {
    container-type: inline-size;
    container-name: zghead;
    height: auto;
    padding: 0 10px 10px 10px;
}

.header-top {
    flex-wrap: wrap;
    gap: 10px;
    margin: clamp(16px, 6vw, 70px) 0 clamp(8px, 1.6vw, 15px) 0 !important;
}

.logo {
    width: clamp(180px, 46vw, 416px);
    height: auto;
    max-width: 100%;
}

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

/* 导航第一行：红色菜单条 */
.navbar {
    width: 100%;
}

.nav-first-row {
    position: relative;
    flex-wrap: wrap;
    padding: 0 10px;
    gap: 0 10px;
}

.navbar-brand {
    margin-right: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 45%;
}

#nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 导航第二行：白色工具条，左右下 1px #CCCCCC */
.nav-second-row {
    background-color: #ffffff;
    border: 0;
    border-left: 1px solid #CCCCCC;
    border-right: 1px solid #CCCCCC;
    border-bottom: 1px solid #CCCCCC;
    padding: 10px;
}

.nav-second-row-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.nav-second-row .form-control {
    width: clamp(120px, 30vw, 260px);
}

.login-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.login-status a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.zg-tool {
    white-space: nowrap;
}

/* 折叠开关：宽屏隐藏 */
.zg-nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.zg-nav-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.15);
}

/* 窄屏：菜单折叠，第二行工具收为图标 */
@container zghead (max-width: 780px) {
    .nav-first-row {
        height: auto;
        min-height: 50px;
        padding: 6px 10px;
    }

    .navbar-brand {
        max-width: 55%;
        padding: 0;
        font-size: 17px;
    }

    .zg-nav-btn {
        display: inline-flex;
        margin-left: auto;
    }

    #nav {
        display: none;
        order: 5;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 6px;
    }

    .zg-nav-toggle:checked ~ #nav {
        display: flex;
    }

    #nav .nav-item {
        margin: 0;
    }

    #nav .nav-link {
        height: auto;
        padding: 10px 12px !important;
        line-height: 1.4;
    }

    .nav-second-row {
        padding: 10px;
    }

    .zg-tool-text {
        display: none;
    }

    .login-status {
        flex-wrap: nowrap;
    }

    .login-status a {
        margin: 0 6px;
        font-size: 16px;
    }

    .nav-second-row .form-control {
        width: 100%;
    }

    .nav-second-row .form-inline {
        width: 100%;
    }
}

/* 用户页：头像下编辑按钮、右侧纵向操作按钮 */
.zg-user__avatar {
    text-align: center;
}

.zg-user__edit {
    grid-area: edit;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    min-height: 26px;
    padding: 2px 10px;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    background-color: #cc0000;
    border: 1px solid #cc0000;
    border-radius: 3px;
}

.zg-user__edit:hover {
    color: #ffffff;
    text-decoration: none;
    background-color: #dd2222;
    border-color: #dd2222;
}

.zg-user__aside {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.zg-user__aside > * {
    flex: 1 1 0;
    min-width: 0;
}

.zg-user__aside .btn {
    width: 100%;
    margin: 0 !important;
    padding: 7px 10px;
    color: #ffffff;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    white-space: normal;
    background-color: #cc0000;
    border: 1px solid #cc0000;
    border-radius: 3px;
}

.zg-user__aside .btn:hover,
.zg-user__aside .btn:focus {
    color: #ffffff;
    background-color: #dd2222;
    border-color: #dd2222;
}

/* 首页轮播：宽度自适应，标题覆盖层/编号沿用原设计 */
.carousel-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    box-sizing: border-box;
}

.carousel-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: clamp(12px, 3vw, 20px);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    color: #ffffff;
    z-index: 5;
    box-sizing: border-box;
}

.carousel-title-overlay h3 {
    color: #ffffff !important;
    font-size: clamp(16px, 2.4vw, 24px);
    font-weight: bold;
    line-height: 1.4;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.carousel-numbers {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 0;
}

.carousel-indicators {
    display: none;
}

.slide-number {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    color: #ffffff;
    font-size: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.slide-number:first-child {
    border-radius: 4px 0 0 4px;
}

.slide-number:last-child {
    border-radius: 0 4px 4px 0;
    border-right: none;
}

.slide-number:hover,
.slide-number.active {
    background-color: rgba(204, 0, 0, 0.5);
    font-weight: bold;
}

/* 首页列表行：标题单行省略，日期固定右侧不换行，避免窄屏换行与重叠 */
.zg-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    line-height: 30px;
    min-width: 0;
}

.zg-list-row--badge {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.zg-list-row--gap:not(:last-child) {
    margin-bottom: 10px;
}

.zg-list-row > a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000000;
}

.zg-list-row .zg-badge {
    color: #cc0000;
    white-space: nowrap;
}

.zg-list-row .zg-date {
    color: #cccccc;
    white-space: nowrap;
}

/* 友情链接行：横向弹性排列，超出一行自动换行 */
.zg-links {
    padding: 10px 0;
    line-height: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    word-break: break-word;
}

.zg-links a {
    display: inline-block;
    padding: 2px 0;
    color: #000000;
}

/* 太极流派 / 图片网格：移动端 2 列，宽容器恢复 7 / 6 列 */
.taiji-liupai-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)) !important;
    gap: 10px 5px !important;
    margin-top: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.taiji-liupai-grid .taiji-item {
    text-align: center;
    min-width: 0;
    width: 100% !important;
}

.taiji-liupai-grid .taiji-img-wrap {
    width: 100% !important;
    max-width: 110px !important;
    height: auto !important;
    aspect-ratio: 6 / 5 !important;
    margin: 0 auto 5px !important;
    overflow: hidden !important;
}

.taiji-liupai-grid .taiji-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.taiji-liupai-grid .taiji-title {
    margin: 5px 0 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

.taiji-liupai-grid .taiji-title a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000000 !important;
    font-size: 13px;
    line-height: 1.5;
}

.taiji-liupai-grid .taiji-title a:hover {
    color: #cc0000 !important;
}

.taiji-pic-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.taiji-pic-grid .taiji-pic-item {
    text-align: center;
    min-width: 0;
    width: 100% !important;
}

.taiji-pic-grid .taiji-pic-wrap {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
    margin: 5px auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #eeeeee !important;
    box-sizing: border-box !important;
}

.taiji-pic-grid .taiji-pic-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.taiji-pic-grid .taiji-pic-title {
    line-height: 20px !important;
}

.taiji-pic-grid .taiji-pic-title a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000000 !important;
    font-size: 12px;
}

.taiji-pic-grid .taiji-pic-title a:hover {
    color: #cc0000 !important;
}

@container zgpage (min-width: 620px) {
    .taiji-liupai-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .taiji-liupai-grid .taiji-img-wrap {
        max-width: 120px !important;
    }

    .taiji-liupai-grid .taiji-title a {
        font-size: 14px;
    }

    .taiji-pic-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .taiji-pic-grid .taiji-pic-wrap {
        margin: 10px auto !important;
        padding: 0 !important;
    }

    .taiji-pic-grid .taiji-pic-title a {
        font-size: 12px;
    }

    /* 双列等高：外壳与内层容器撑满；幻灯片图片自适应填充，不溢出 */
    .row.mb-4.row-split > .zg-shell,
    .row.mb-4.row-halves > .zg-shell {
        display: flex;
        flex-direction: column;
    }

    .row.mb-4.row-split > .zg-shell > .col-left,
    .row.mb-4.row-split > .zg-shell > .col-right,
    .row.mb-4.row-halves > .zg-shell > .grid-container {
        flex: 1 1 auto;
        min-height: 0;
    }

    .col-left {
        display: flex;
        flex-direction: column;
    }

    .col-left > .carousel {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .col-left > .carousel > .carousel-inner {
        flex: 1 1 auto;
        min-height: 0;
    }

    .col-left .carousel-item,
    .col-left .carousel-item > a {
        height: 100%;
    }

    .col-left .carousel-item > a {
        display: block;
        position: relative;
    }

    .col-left .carousel-item img {
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
    }

    .col-left .zg-slide-placeholder {
        flex: 1 1 auto;
        display: flex;
        min-height: 0;
    }

    .col-left .zg-slide-placeholder img {
        height: 100%;
        object-fit: cover;
    }
}

/* 窄屏：双块行改为单列 */
@container zgpage (max-width: 619px) {
    .row.mb-4.row-split,
    .row.mb-4.row-halves {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 小屏：压缩幻灯片编号内边距，保证 10 个编号完整落在图片内 */
@container zgpage (max-width: 400px) {
    .carousel-numbers {
        max-width: 100%;
    }

    .slide-number {
        padding: 5px 6px;
    }

    /* 动态列表的栏目徽标与区块标题重复，窄屏隐藏以优先保证文章标题可读 */
    .zg-list-row--badge {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .zg-list-row--badge .zg-badge {
        display: none;
    }
}

/* iPhone X 及以上安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #footer {
        padding-bottom: calc(40px + env(safe-area-inset-bottom)) !important;
    }
}

/* 页脚宽度约束已统一至上方 #footer .wp（1280px） */

/* 导航菜单宽屏横排（仅限头部导航，避免影响其他页面内的导航列表） */
#nav {
    flex-direction: row;
}

/* 窄屏第二行：搜索输入与按钮保持一行 */
@container zghead (max-width: 780px) {
    .nav-second-row .form-inline {
        flex-wrap: nowrap;
    }

    .nav-second-row .form-control {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }
}
@container zghead (max-width: 780px) {
    #nav {
        flex-direction: column;
    }
}

/* ============================================================
   区域白壳与间距修正
   每个区域各自一层 10px 白底；相邻区域左右、上下间隔均为 10px
   ============================================================ */

/* 主内容块：独立白壳 */
.main-wrapper {
    background-color: #fff;
    padding: 10px;
    margin: 0 0 10px 0;
    box-sizing: border-box;
}

/* 扁平模式首页：列表一块；右侧每个边栏各自一块 */
.row.zg-regions {
    background: transparent;
    padding: 0;
    margin: 0 0 10px 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.row.zg-regions > .main {
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* 列表外壳：10px 白色外壳，边框加在白壳里层 */
.zg-list-shell {
    background-color: #fff;
    padding: 10px;
    box-sizing: border-box;
}

/* 白壳里层：上方 2px #D01F3F、其余 1px #DDDDDD 边框 */
.zg-list-inner {
    border-top: 2px solid #D01F3F;
    border-left: 1px solid #DDDDDD;
    border-right: 1px solid #DDDDDD;
    border-bottom: 1px solid #DDDDDD;
    box-sizing: border-box;
}

/* 编辑工具栏与分页：位于列表外壳之外，与外壳间隔 25px */
.zg-list-extra {
    margin-top: 25px;
}

/* 编辑工具栏与翻页控件之间保持 25px 间距 */
.zg-list-extra > :not(:first-child) {
    margin-top: 25px !important;
}

.zg-list-extra > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.zg-list-extra .mod-button,
.zg-list-extra .pagination {
    margin: 0 !important;
}

.row.zg-regions > .aside {
    background: transparent;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

/* 侧边栏：每个边栏各一层 10px 白色外壳，边框加在白壳里层 */
.row.zg-regions > .aside > .zg-side-shell {
    background-color: #fff;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
}

/* 白壳里层：1px #EEEEEE 边框包裹内容 */
.row.zg-regions > .aside .zg-side-box {
    background-color: #fff;
    margin: 0 !important;
    width: 100%;
    border: 1px solid #EEEEEE;
    border-radius: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* 带标题的侧栏：标题区 #F2F2F2 背景 */
.row.zg-regions > .aside .card-header {
    background: #F2F2F2 !important;
    border-bottom: 1px solid #E5E5E5;
    border-radius: 0;
    margin: 0;
    padding: 8px 10px;
}

.row.zg-regions > .aside .card-body {
    padding: 10px;
}

.row.zg-regions > .aside .zg-links {
    padding: 0;
}

.row.zg-regions > .aside .card-footer {
    background: transparent;
    border-top: 1px solid #E5E5E5;
    padding: 10px;
    margin: 0;
}

.row.zg-regions > .aside .list-group-item {
    background: transparent !important;
    padding-left: 10px;
    padding-right: 10px;
}

/* 统计区（文章数/评论数等）背景 #F7F7F7，站点名称与描述保持白底 */
.row.zg-regions > .aside .zg-side-stats {
    background-color: #F7F7F7 !important;
}

/* 单页：正文与侧栏为两块并列的独立白壳，间隔 10px */
.zg-single-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 10px;
    align-items: start;
}

.zg-single-layout > .main-wrapper {
    margin: 0;
}

.zg-single-aside .aside {
    margin: 0;
}

/* 窄屏单页：侧栏移到正文之前，列表按可用宽度弹性分列 */
@container zgpage (max-width: 959.98px) {

    /* 窄屏：侧栏独立一块，移到面包屑与正文之间 */
    .zg-single-layout > .zg-single-aside {
        order: -1;
    }

    /* 单页列表按可用宽度弹性分列，只有放不下一列时才纵向堆叠 */
    .zg-single-aside .threadlist {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0 10px;
    }
}

/* 宽屏扁平首页：主列表与侧栏 3:1 两栏（容器查询替代视口媒体查询） */
@container zgpage (min-width: 960px) {
    .row.zg-regions {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        flex-wrap: nowrap;
    }

    .row.zg-regions > .main,
    .row.zg-regions > .aside {
        flex: none;
        width: auto;
        max-width: none;
    }

    .row.zg-regions > .main {
        padding: 0;
    }

    .row.zg-regions > .aside {
        padding: 0;
        display: flex !important;
    }
}

/* 用户页头像区：上下两半各有一圈 10px 白色外壳，两半相连；头像骑在分界线上 */
.zg-profile {
    position: relative;
    background-color: #fff;
    padding: 10px;
    margin: 0 0 10px 0;
    box-sizing: border-box;
}

.zg-profile__top {
    height: 80px;
    background-color: #000;
}

.zg-profile__body {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
        "ava info"
        "edit stats"
        "aside aside";
    column-gap: 16px;
    row-gap: 8px;
    padding: 0 0 0 10px;
    align-items: start;
}

.zg-profile__avatar {
    grid-area: ava;
    width: 96px;
    margin-top: -48px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.zg-profile__avatar > a {
    display: block;
}

.zg-profile__avatar img {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid #fff;
    background-color: #fff;
    object-fit: cover;
}

.zg-profile__main {
    grid-area: info;
    min-width: 0;
    padding-top: 10px;
}

.zg-profile__main .h5 {
    margin-bottom: 4px;
}

/* 文章数/评论数：靠左排列，与编辑资料按钮同一行、同一高度 */
.zg-profile__stats {
    grid-area: stats;
    justify-self: start;
    align-self: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.zg-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 2px 10px;
    box-sizing: border-box;
    background-color: #F6F8F9;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.zg-stat b {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: #333;
}

.zg-user__aside {
    grid-area: aside;
    justify-self: stretch;
    width: 100%;
}

@container zgpage (min-width: 560px) {
    .zg-profile__body {
        grid-template-columns: 96px minmax(0, 1fr) auto;
        grid-template-areas:
            "ava info aside"
            "edit stats aside";
    }

    /* 审核内容/写文章：在头像区下半部分垂直居中 */
    .zg-user__aside {
        justify-self: end;
        align-self: stretch;
        justify-content: center;
        width: 110px;
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .zg-user__aside > * {
        flex: 0 0 auto;
    }
}

/* 导航菜单：菜单行高度固定，悬停/选中背景不越出红色菜单条 */
.nav-first-row {
    height: 50px;
    align-items: stretch;
    flex-wrap: wrap;
    padding: 0 10px;
    gap: 0 10px;
}

#nav {
    height: 100%;
    align-items: stretch;
    flex-direction: row;
    margin: 0;
    padding: 0;
    list-style: none;
}

#nav .nav-item {
    display: flex;
    height: 100%;
    margin: 0;
}

#nav .nav-link {
    display: flex;
    align-items: center;
    height: 100% !important;
    padding: 0 20px !important;
    line-height: 1.4;
    box-sizing: border-box;
}

@container zghead (max-width: 780px) {
    .nav-first-row {
        height: auto;
        min-height: 50px;
        align-items: center;
        padding: 6px 10px;
        gap: 0 10px;
    }

    #nav {
        display: none;
        height: auto;
        width: 100%;
        margin-top: 6px;
        flex-direction: column;
        align-items: stretch;
        order: 5;
    }

    .zg-nav-toggle:checked ~ #nav {
        display: flex;
    }

    #nav .nav-item {
        display: block;
        height: auto;
    }

    #nav .nav-link {
        display: block;
        height: auto !important;
        padding: 10px 12px !important;
        line-height: 1.4;
    }

    .zg-nav-btn {
        margin-left: auto;
    }
}

/* 宽屏导航菜单贴住红色条左边缘 */
@container zghead (min-width: 781px) {
    .nav-first-row {
        padding: 0;
    }
}