/* 手机版补充样式：学习资料卡片 + 手机友链 + 笔顺页重排
   基础样式来自 /static/mobile/css/style.css，这里只补新增块，并修正移动端默认链接样式 */

/* ===== 学习资料卡片（后台可配置，紧凑单卡） ===== */
.m-ad {
    margin: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #ece5d8;
    overflow: hidden;
}

.m-ad .mcon {
    padding: 0.7rem 0.75rem;
    background: #fff;
}

.m-ad-title {
    font-size: 0.78rem;
    color: #8a7a68;
    line-height: 1.4;
    padding-left: 0.45rem;
    border-left: 0.16rem solid #c5653e;
    margin-bottom: 0.55rem;
}

.m-ad-body {
    display: flex;
    align-items: flex-start;
}

.m-ad-pic {
    display: block;
    flex: 0 0 3.6rem;
    width: 3.6rem;
    height: 3.6rem;
    margin-right: 0.6rem;
    overflow: hidden;
    background: #f6f2e8;
}

.m-ad-pic img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.m-ad-info {
    flex: 1;
    min-width: 0;
}

.m-ad-info h4 {
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1.45;
    color: #725B47;
}

.m-ad-info h4 a {
    color: #725B47 !important;
    text-decoration: none !important;
    border: 0 !important;
}

.m-ad-info p {
    margin: 0;
    font-size: 0.72rem;
    color: #999;
    line-height: 1.6;
    text-align: left;
    text-indent: 0;
}

.m-ad-btn {
    display: inline-block;
    margin-top: 0.45rem;
    padding: 0 0.7rem;
    height: 1.7rem;
    line-height: 1.7rem;
    font-size: 0.72rem;
    color: #fff !important;
    background: #c5653e;
    border-radius: 0.12rem;
    text-decoration: none !important;
    border: 0 !important;
}

.m-ad-btn:active {
    opacity: .85;
}

/* ===== 手机友链：照电脑版友链版式（白底细边框面板 + 标题 + 圆点分隔的链接行） ===== */
.m-flink {
    margin: 0.55rem 0.75rem 0.5rem;
    padding: 0.6rem 0.72rem 0.5rem;
    background: #fff;
    border: 1px solid #ece5d8;
    border-radius: 0.16rem;
    box-shadow: none;
}

.m-flink .panel,
.m-flink .mcon {
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

.m-flink h3 {
    font-size: 0.82rem;
    font-weight: bold;
    color: #725b47;
    margin: 0 0 0.3rem;
    padding-left: 0.42rem;
    border-left: 0.14rem solid #c5653e;
    line-height: 1.1;
}

.m-flink p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.9;
    color: #555;
    word-break: break-all;
}

.m-flink a {
    position: relative;
    display: inline-block;
    padding: 0 0.62rem;
    color: #555 !important;
    font-size: 0.78rem;
    text-decoration: none !important;
    border: 0 !important;
    margin: 0;
}

.m-flink a:first-child {
    padding-left: 0;
}

.m-flink a::after {
    content: "·";
    position: absolute;
    right: 0.12rem;
    top: 0;
    color: #b9ada0;
}

.m-flink a:last-child::after {
    content: "";
}

/* ===== 顶部「更多」入口：放大点击热区，手机上更好点 ===== */
.nav-square {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0.25rem;
    background-size: 1.6rem 1.6rem;
}

/* ===== 兜底：万一电脑版右栏被带进来，手机端一律不显示 ===== */
.rightbox {
    display: none !important;
}

/* ===== 成语合集分类格：电脑版一行 6 个，手机屏幕装不下 4 字分类名，改一行 3 个并允许换行 ===== */
.btn.cyjibtn {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.375rem;
    margin: 0 !important;
    padding: 0;
    align-items: stretch;
}

.btn.cyjibtn li {
    float: none !important;
    width: auto !important;
    white-space: normal !important;
    min-width: 0;
    box-sizing: border-box;
}

.btn.cyjibtn li a {
    white-space: normal !important;
    text-overflow: clip;
    line-height: 1.35;
    text-align: center;
    padding: 0.45rem 0.2rem;
    margin: 0 !important;
    height: 100%;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

/* ===== 笔顺页（手机）：标题与字形动画不再互相压字，笔画顺序/分步图/综合图按原站手机版重排 ===== */
body.bs-page .mcon h1 {
    font-size: 1.65rem;
    letter-spacing: 0.1rem;
    text-indent: 0.1rem;
    line-height: 1.4;
    margin: 0.1rem 0 0.4rem;
    padding-right: 6.2rem;
}

body.bs-page .zipic {
    position: static !important;
    float: right;
    margin: 0 0 0.5rem 0.7rem;
    border: 1px solid #c5653e;
    background: transparent url(../images/zibg.gif) no-repeat center center;
    background-size: 100% 100%;
    width: 5.6rem;
    height: 5.6rem;
    overflow: hidden;
}

body.bs-page .zipic img {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    display: block;
}

body.bs-page .zipic svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
    overflow: hidden;
}

body.bs-page ul.bsbh li {
    width: 20%;
    float: left;
}

body.bs-page ul.bsbh li p {
    margin: 0 0.09375em;
    padding: 0 0.375em;
    background: #fff;
    border: 1px solid #6C757D;
    display: block;
    overflow: hidden;
}

body.bs-page ul.bsbh li p .bsshu {
    display: block;
    font-size: 0.875rem;
    line-height: 1.8;
    text-align: center;
}

body.bs-page ul.bsbh li p img {
    display: block;
    width: 2.125em;
    height: 2.125em;
    margin: 0 auto;
    border: 0;
}

body.bs-page ul.bsbh li p .bsname {
    display: block;
    font-size: 0.75rem;
    line-height: 1.9;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.bs-page ul.bsfb li {
    width: 33.3333%;
    float: left;
}

body.bs-page ul.bsfb li p {
    margin: 0 0.15625em;
    display: block;
}

body.bs-page ul.bsfb li p img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
}

body.bs-page .bszh {
    text-align: center;
}

body.bs-page .bszh img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* ===== 手机页头：印章「国学」+ 站名作为一组居中，窄屏不再挤在一起 ===== */
.header .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1.9rem 0.75rem 1.1rem;
    height: auto;
}

.header .brand .csiteh {
    flex: 0 0 auto;
    margin-right: 0;
    vertical-align: baseline;
    width: 1.5rem;
    height: 2.2rem;
    background: transparent url(../images/pphb.png) no-repeat center center;
    background-size: contain;
}

.header .brand .site {
    font-size: 2rem !important;
    line-height: 1.1;
    height: auto;
    white-space: nowrap;
}

/* 笔顺页：字格浮在标题右侧，下面的属性行必须整行落在格子下方，避免文字被挤成竖条 */
body.bs-page .mcon .l250 {
    clear: both;
}
