/* ==========================================================================
   MacDown M 端样式，支持 4 套配色
   配色：金黄(默认) / 科技蓝 / 清新绿 / 典雅紫
   ========================================================================== */

/* ---------- 配色变量（默认：金黄） ---------- */
:root {
  --cs-primary: #FFBD0A;
  --cs-primary-dark: #8B5615;
  --cs-primary-light: rgba(255, 189, 10, 0.3);
  --cs-bg: #FBF7EA;
  --cs-bg-grad: linear-gradient(#FFBD0A 0, #FBF7EA 260px, #FBF7EA 100%);
  --cs-tint: rgba(255, 189, 10, 0.12);
  --cs-header-grad: linear-gradient(-90deg, #FFD700, #FFBD0A);
  --cs-btn-grad: linear-gradient(135deg, #FFD75E, #FFBD0A);
  --cs-text: #333333;
  --cs-text-light: #999999;
  --cs-border: #EEEEEE;
  --cs-card-bg: #FFFDF6;
  --cs-card-line: rgba(255, 189, 10, 0.32);
}
body.macdown-cs-blue {
  --cs-primary: #2F7BFF;
  --cs-primary-dark: #1F4E9E;
  --cs-primary-light: rgba(47, 123, 255, 0.3);
  --cs-bg: #E2EAF6;
  --cs-bg-grad: linear-gradient(#4D9AFF 0, #E2EAF6 440px, #E2EAF6 100%);
  --cs-tint: rgba(47, 123, 255, 0.12);
  --cs-header-grad: linear-gradient(-90deg, #4D9AFF, #2F7BFF);
  --cs-btn-grad: linear-gradient(135deg, #5AA6FF, #2F7BFF);
  --cs-card-bg: #F7FAFF;
  --cs-card-line: rgba(47, 123, 255, 0.25);
}
body.macdown-cs-green {
  --cs-primary: #12B76A;
  --cs-primary-dark: #136B45;
  --cs-primary-light: rgba(18, 183, 106, 0.3);
  --cs-bg: #E6F6EC;
  --cs-bg-grad: linear-gradient(#3CE08F 0, #E6F6EC 440px, #E6F6EC 100%);
  --cs-tint: rgba(18, 183, 106, 0.12);
  --cs-header-grad: linear-gradient(-90deg, #3CE08F, #12B76A);
  --cs-btn-grad: linear-gradient(135deg, #3CE08F, #12B76A);
  --cs-card-bg: #F6FCF8;
  --cs-card-line: rgba(18, 183, 106, 0.28);
}
body.macdown-cs-purple {
  --cs-primary: #7C5CFF;
  --cs-primary-dark: #4A3A9E;
  --cs-primary-light: rgba(124, 92, 255, 0.3);
  --cs-bg: #E8E2F6;
  --cs-bg-grad: linear-gradient(#9D85FF 0, #E8E2F6 440px, #E8E2F6 100%);
  --cs-tint: rgba(124, 92, 255, 0.12);
  --cs-header-grad: linear-gradient(-90deg, #9D85FF, #7C5CFF);
  --cs-btn-grad: linear-gradient(135deg, #9D85FF, #7C5CFF);
  --cs-card-bg: #FAF8FF;
  --cs-card-line: rgba(124, 92, 255, 0.25);
}

/* ---------- 全局重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--cs-text);
  background: var(--cs-bg);
  line-height: 1.5;
  min-width: 100%;
  padding-bottom: 60px;
}
a { text-decoration: none; color: inherit; display: block; }
img { display: block; max-width: 100%; }
ul, li { list-style: none; }
.clearfix::after { content: ""; display: block; clear: both; }

/* ---------- 头部 ---------- */
.m-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--cs-header-grad);
  padding: 8px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.m-header .top-row { display: flex; align-items: center; gap: 10px; }
.m-header .logo { flex-shrink: 0; }
.m-header .logo img { height: 30px; width: auto; }
.m-header .search-bar {
  flex: 1; height: 34px;
  background: rgba(255,255,255,0.95);
  border-radius: 17px;
  display: flex; align-items: center;
  padding: 0 12px;
}
.m-header .search-bar form { flex: 1; min-width: 0; display: flex; align-items: center; }
.m-header .search-bar input {
  flex: 1; width: 100%; min-width: 0; border: none; outline: none;
  background: transparent;
  font-size: 13px; color: #333;
}
.m-header .search-bar .search-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  background: var(--cs-primary-dark);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M21 21l-4.3-4.3' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M21 21l-4.3-4.3' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.m-header .feedback { flex-shrink: 0; color: #fff; font-size: 12px; }

/* 导航 */
.m-nav {
  display: flex; overflow-x: auto;
  margin-top: 8px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.m-nav::-webkit-scrollbar { display: none; }
.m-nav a {
  flex-shrink: 0;
  color: #fff; font-size: 15px;
  padding: 6px 14px;
  white-space: nowrap;
  opacity: 0.85;
}
.m-nav a.active { opacity: 1; font-weight: bold; position: relative; }
.m-nav a.active::after {
  content: ""; position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; border-radius: 2px;
  background: #fff;
}

/* ---------- 版块标题 ---------- */
.m-section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 14px 10px;
}
.m-section-title h3 {
  font-size: 17px; font-weight: 800; color: #1A1A1A;
  position: relative; padding-left: 11px; letter-spacing: .2px;
}
.m-section-title h3::before {
  content: ""; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 2px;
  background: var(--cs-primary);
}
.m-section-title .more { font-size: 12px; color: #9A9A9A; }
.m-section-title .refresh {
  font-size: 12px; color: var(--cs-primary-dark);
  background: var(--cs-tint);
  padding: 4px 12px; border-radius: 999px;
  cursor: pointer;
}
.m-section-title .refresh::before { content: "⟳"; margin-right: 3px; }

/* ---------- 版块卡片（每个模块外框） ---------- */
.m-sec {
  margin: 10px 12px;
  padding: 13px 12px 12px;
  background: var(--cs-card-bg, #FFFFFF);
  border: 1px solid var(--cs-card-line, #E8E8E8);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.035);
  overflow: hidden;
}
.m-sec .m-section-title { padding: 0 2px 10px; }
.m-sec .m-section-title h3 {
  padding-left: 0;
  padding-right: 2px;
  background: linear-gradient(transparent 62%, var(--cs-primary-light) 62%);
}
.m-sec .m-section-title h3::before { display: none; }
.m-sec .m-grid-list { padding: 0 0 2px; }
.m-sec .m-taglist { padding: 0 0 2px; }
.m-sec .m-tabs { padding: 0 2px 10px; }
.m-sec .m-list { padding: 0; }
.m-sec .m-card-grid { padding: 0 0 2px; }
.m-sec .m-collection-grid { padding: 0; }

/* ---------- 版块内 Tab ---------- */
.m-tabs {
  display: flex; gap: 18px; padding: 0 14px 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tabs a {
  flex-shrink: 0; font-size: 14px; color: #6E6E6E;
  padding-bottom: 5px; position: relative;
}
.m-tabs a.active { color: #1A1A1A; font-weight: 700; }
.m-tabs a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 2px;
  background: var(--cs-primary);
}
.m-tab-pane { display: none; }
.m-tab-pane.active { display: block; }

/* ---------- 标签云 ---------- */
.m-taglist {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 12px 6px;
}
.m-taglist a {
  padding: 6px 13px; font-size: 12px; color: #4A4A4A;
  background: #fff; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 轮播 ---------- */
.m-swiper { position: relative; margin: 10px 12px 0; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.07); }
.m-swiper .swiper-box { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.m-swiper .swiper-box::-webkit-scrollbar { display: none; }
.m-swiper .swiper-slide { position: relative; flex-shrink: 0; width: 100%; scroll-snap-align: start; }
.m-swiper .swiper-slide img { width: 100%; height: 176px; object-fit: cover; }
/* 幻灯片底部标题浮层 */
.m-swiper .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 12px 18px;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  color: #fff;
}
.m-swiper .cap b {
  display: block; font-size: 15px; font-weight: 700; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-swiper .cap span {
  display: block; margin-top: 3px; font-size: 11px; opacity: .85; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 头条：单行滚动条 */
.m-topnews {
  display: flex; align-items: center; gap: 8px;
  height: 38px; margin: 10px 12px 0; padding: 0 8px 0 9px;
  background: #fff; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  overflow: hidden;
}
.m-topnews .tn-badge {
  flex-shrink: 0;
  font-size: 12px; font-weight: 800; letter-spacing: 1px;
  color: #fff; font-style: italic;
  background: linear-gradient(135deg, #FF6A3D, #FF2D55);
  padding: 4px 8px 4px 7px; border-radius: 7px;
  transform: skewX(-8deg);
}
.m-topnews .tn-roll {
  flex: 1; min-width: 0; height: 38px; overflow: hidden;
}
.m-topnews .tn-list {
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}
.m-topnews .tn-item {
  display: block; height: 38px; line-height: 38px;
  font-size: 13px; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-topnews .tn-more {
  flex-shrink: 0; padding-left: 2px;
  font-size: 18px; line-height: 1; color: #B5B5B5;
}
.m-swiper .dots {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px; align-items: center;
}
.m-swiper .dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.m-swiper .dots span.active { background: #fff; width: 16px; border-radius: 3px; }

/* ---------- 头条/推荐 ---------- */
.m-headline {
  margin: 12px; padding: 12px;
  background: var(--cs-tint); border-radius: 12px;
  display: flex; gap: 12px;
}
.m-headline img { width: 120px; height: 80px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.m-headline .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-headline .title { font-size: 15px; font-weight: bold; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-headline .meta { margin-top: auto; font-size: 12px; color: var(--cs-text-light); }

/* ---------- 分类筛选条（横向 pill） ---------- */
.m-filter {
  display: flex; gap: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 10px 12px;
}
.m-filter::-webkit-scrollbar { display: none; }
.m-filter a {
  flex-shrink: 0; height: 30px; line-height: 30px;
  padding: 0 15px; font-size: 13px; color: #4A4A4A;
  background: #fff; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  white-space: nowrap;
}
.m-filter a.active {
  background: var(--cs-primary); color: #fff; font-weight: 700;
  box-shadow: 0 2px 8px var(--cs-primary-light);
}

/* ---------- 4列网格列表（图标+名称+按钮） ---------- */
.m-grid-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 10px;
  padding: 0 12px 16px;
}
.m-grid-list .item {
  display: flex; flex-direction: column; align-items: center;
  min-width: 0;
  text-align: center;
}
.m-grid-list .item .icon {
  width: 56px; height: 56px; margin: 0 auto;
  border-radius: 14px; overflow: hidden;
}
.m-grid-list .item .icon img { width: 100%; height: 100%; object-fit: cover; }
.m-grid-list .item .name {
  font-size: 12px; margin: 6px 0 0; line-height: 1.35;
  width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-grid-list .item .btn {
  display: inline-block;
  margin: 6px 0 0; padding: 0 18px; height: 26px; line-height: 26px;
  font-size: 12px; color: var(--cs-primary-dark);
  background: var(--cs-tint);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- 3列卡片流（文章/攻略，紧凑版） ---------- */
.m-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px 12px;
}
.m-card-grid .card {
  background: #fff; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.m-card-grid .card .cover {
  position: relative; width: 100%; padding-top: 100%; overflow: hidden;
  background: var(--cs-primary-light);
}
.m-card-grid .card .cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.m-card-grid .card .name {
  padding: 7px 8px 8px; font-size: 12px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all; min-height: 32px;
}
.m-card-grid .card .btn {
  align-self: center; margin: 0 8px 9px; padding: 0 14px; height: 24px; line-height: 24px;
  font-size: 11px; color: var(--cs-primary-dark);
  background: var(--cs-tint); border-radius: 999px;
}

/* ---------- 横向滚动列表（大图标） ---------- */
.m-scroll-list {
  display: flex; overflow-x: auto;
  padding: 0 12px 16px; gap: 12px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.m-scroll-list::-webkit-scrollbar { display: none; }
.m-scroll-list .item { flex-shrink: 0; width: 96px; text-align: center; }
.m-scroll-list .item .icon { width: 72px; height: 72px; margin: 0 auto; border-radius: 18px; overflow: hidden; }
.m-scroll-list .item .icon img { width: 100%; height: 100%; object-fit: cover; }
.m-scroll-list .item .name {
  font-size: 12px; margin-top: 6px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}

/* ---------- 列表项（大图 + 简介 + 胶囊按钮） ---------- */
.m-list { padding: 0 12px; }
.m-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(0,0,0,.055);
}
.m-list li:last-child { border-bottom: none; }
.m-list li .icon { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.m-list li .icon img { width: 100%; height: 100%; object-fit: cover; }
.m-list li .info { flex: 1; min-width: 0; }
.m-list li .info .name {
  font-size: 15px; font-weight: 700; line-height: 1.4; color: #1A1A1A;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.m-list li .info .desc { font-size: 11px; color: #9A9A9A; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-list li .info .meta { font-size: 11px; color: #9A9A9A; margin-top: 2px; }
.m-list li .info .intro {
  font-size: 12px; color: #8C8C8C; margin-top: 5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.m-list li .btn {
  flex-shrink: 0; align-self: center;
  padding: 6px 15px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: var(--cs-primary-dark);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- 分类导航入口 ---------- */
.m-cate-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 0;
  padding: 16px 12px;
  background: #fff;
  margin: 0 12px;
  border-radius: 10px;
}
.m-cate-nav .item { text-align: center; }
.m-cate-nav .item .icon {
  width: 44px; height: 44px; margin: 0 auto;
  border-radius: 50%;
  background: var(--cs-header-grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: bold;
  box-shadow: 0 3px 8px var(--cs-primary-light);
}
.m-cate-nav .item .name { font-size: 12px; margin-top: 6px; color: var(--cs-text); }

/* ---------- 详情页 ---------- */
.m-detail { padding: 0; }
.m-detail .m-appcard {
  margin: 12px; padding: 14px;
  background: var(--cs-card-bg, #FFFFFF);
  border: 1px solid var(--cs-card-line, #E8E8E8);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.035);
}
.m-detail .app-info {
  display: flex; gap: 12px; padding: 0;
  background: transparent;
}
.m-detail .app-info .icon { width: 72px; height: 72px; border-radius: 18px; overflow: hidden; flex-shrink: 0; }
.m-detail .app-info .icon img { width: 100%; height: 100%; object-fit: cover; }
.m-detail .app-info .info { flex: 1; min-width: 0; }
.m-detail .app-info .info h1 {
  font-size: 20px; font-weight: 800; color: #1A1A1A; line-height: 1.3;
}
.m-detail .app-info .info .meta { font-size: 12px; color: var(--cs-text-light); margin-top: 5px; }
.m-detail .app-info .info .tags { margin-top: 6px; }
.m-detail .app-info .info .tags span {
  display: inline-block; font-size: 11px;
  padding: 2px 8px; margin-right: 6px;
  background: var(--cs-primary-light); color: var(--cs-primary-dark);
  border-radius: 8px;
}
/* 版本 / 大小 / 所需权限 / 隐私政策 四栏 */
.m-detail .app-meta4 {
  display: flex; padding: 10px 0;
  background: var(--cs-tint); border-radius: 12px;
}
.m-detail .app-meta4 > div { flex: 1; min-width: 0; text-align: center; padding: 0 4px; }
.m-detail .app-meta4 b {
  display: block; font-size: 14px; font-weight: 800; color: #1A1A1A;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-detail .app-meta4 b a {
  display: inline; font-weight: 800; color: var(--cs-primary-dark);
}
.m-detail .app-meta4 span {
  display: block; margin-top: 3px; font-size: 11px; color: var(--cs-text-light);
}

/* 整行宽下载按钮 */
.m-detail .m-dlbtns {
  display: flex; gap: 10px; padding: 14px 0; background: transparent;
}
.m-dlbtns .btn {
  flex: 1; height: 46px; line-height: 46px; text-align: center;
  border-radius: 23px; font-size: 16px; font-weight: 800;
  color: #fff; background: var(--cs-primary);
  box-shadow: 0 4px 12px var(--cs-primary-light);
}
.m-dlbtns .btn.secondary {
  background: var(--cs-tint); color: var(--cs-primary-dark); box-shadow: none;
}
.m-detail .section {
  margin: 10px 12px; padding: 13px 12px;
  background: var(--cs-card-bg, #FFFFFF);
  border: 1px solid var(--cs-card-line, #E8E8E8);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.035);
}
.m-detail .section .m-list { padding: 0; }
.m-detail .section h3 {
  font-size: 16px; font-weight: bold; margin-bottom: 12px;
  color: var(--cs-primary-dark);
}
.m-detail .section .content { font-size: 14px; line-height: 1.8; }
.m-detail .section .content img { margin: 10px 0; border-radius: 8px; }

/* 截图轮播 */
.m-shots-wrap { position: relative; background: transparent; }
.m-shots {
  display: flex; overflow-x: auto; gap: 10px;
  padding: 0 0 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.m-shots::-webkit-scrollbar { display: none; }
.m-shots img { width: 180px; height: 320px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.m-shots-wrap .num {
  position: absolute; right: 16px; bottom: 24px;
  padding: 2px 9px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px;
}

/* 纯文字列表（相关攻略） */
.m-list-plain li { align-items: center; }
.m-list-plain .info { flex: 1; min-width: 0; }
.m-list-plain .name { font-size: 14px; font-weight: 600; color: #1A1A1A; line-height: 1.45; }
.m-list-plain .meta { font-size: 11px; color: var(--cs-text-light); margin-top: 4px; }

/* 信息表 */
.m-info-table { width: 100%; font-size: 13px; }
.m-info-table td { padding: 8px 0; border-bottom: 1px solid var(--cs-border); }
.m-info-table td:first-child { color: var(--cs-text-light); width: 90px; }
.m-info-table td:last-child { color: var(--cs-text); }

/* ---------- 文章页 ---------- */
.m-article {
  margin: 10px 12px; padding: 14px 12px;
  background: var(--cs-card-bg, #FFFFFF);
  border: 1px solid var(--cs-card-line, #E8E8E8);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.035);
}
.m-article h1 { font-size: 20px; font-weight: bold; line-height: 1.4; }
.m-article .article-meta { font-size: 12px; color: var(--cs-text-light); margin-top: 10px; }
.m-article .article-content { font-size: 15px; line-height: 1.8; margin-top: 16px; }
.m-article .article-content img { margin: 12px 0; border-radius: 8px; }

/* ---------- 合集页 ---------- */
.m-collection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
}
.m-collection-grid .card {
  background: #fff; border-radius: 10px; overflow: hidden;
}
.m-collection-grid .card .cover {
  position: relative; width: 100%; height: 110px; overflow: hidden;
  background: var(--cs-primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--cs-primary-dark); font-weight: bold;
}
.m-collection-grid .card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-collection-grid .card .name {
  padding: 10px; font-size: 13px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}

/* ---------- 面包屑 ---------- */
.m-breadcrumb {
  padding: 12px 14px; font-size: 13px; color: var(--cs-text-light);
}
.m-breadcrumb a { display: inline; color: var(--cs-text-light); }
.m-breadcrumb .sep { margin: 0 6px; }

/* ---------- 分页 ---------- */
.m-pagebar {
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: center;
  gap: 6px; padding: 18px 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.m-pagebar a, .m-pagebar span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 32px; padding: 0 10px;
  font-size: 13px; background: #fff; border-radius: 6px;
  color: var(--cs-text); white-space: nowrap;
  flex-shrink: 0; box-sizing: border-box;
}
.m-pagebar .current { background: var(--cs-primary); color: #fff; font-weight: 700; }
.m-pagebar .omit { background: transparent; padding: 0 4px; min-width: auto; color: var(--cs-text-light); }
.m-pagebar .nav-btn { padding: 0 14px; font-weight: 600; }

/* ---------- 底部 ---------- */
.m-footer {
  padding: 20px 14px; text-align: center;
  font-size: 12px; color: #9A9A9A;
  line-height: 1.8;
  background: #333;
  margin-top: 8px;
}
.m-footer a { display: inline; color: #B8B8B8; }

/* ---------- 底部导航栏 ---------- */
.m-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px; background: #fff;
  display: flex; border-top: 1px solid var(--cs-border);
  z-index: 100;
}
.m-tabbar a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 11px; color: var(--cs-text-light);
  gap: 2px;
}
.m-tabbar a .tab-icon {
  width: 22px; height: 22px;
  background: var(--cs-text-light);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: 22px 22px; mask-size: 22px 22px;
}
.m-tabbar a:nth-child(1) .tab-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L2 12h3v8h6v-6h2v6h6v-8h3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L2 12h3v8h6v-6h2v6h6v-8h3z'/%3E%3C/svg%3E");
}
.m-tabbar a:nth-child(2) .tab-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zM8 9h2v2h2v2h-2v2H8v-2H6v-2h2V9zm6 1a1.5 1.5 0 110 3 1.5 1.5 0 010-3zm2.5 3.5a1.5 1.5 0 110 3 1.5 1.5 0 010-3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zM8 9h2v2h2v2h-2v2H8v-2H6v-2h2V9zm6 1a1.5 1.5 0 110 3 1.5 1.5 0 010-3zm2.5 3.5a1.5 1.5 0 110 3 1.5 1.5 0 010-3z'/%3E%3C/svg%3E");
}
.m-tabbar a:nth-child(3) .tab-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zm10 0h8v8h-8zM3 13h8v8H3zm10 0h8v8h-8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zm10 0h8v8h-8zM3 13h8v8H3zm10 0h8v8h-8z'/%3E%3C/svg%3E");
}
.m-tabbar a:nth-child(4) .tab-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1zm2 4v2h12V7H6zm0 4v2h12v-2H6zm0 4v2h8v-2H6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1zm2 4v2h12V7H6zm0 4v2h12v-2H6zm0 4v2h8v-2H6z'/%3E%3C/svg%3E");
}
.m-tabbar a.active { color: var(--cs-primary-dark); }
.m-tabbar a.active .tab-icon { background: var(--cs-primary-dark); }

/* ---------- 空状态 ---------- */
.m-empty { text-align: center; padding: 60px 20px; color: var(--cs-text-light); font-size: 14px; }

/* ---------- 下载按钮统一：主题渐变胶囊（清新绿等 4 套配色自动跟随） ---------- */
.m-grid-list .item .btn {
  height: 28px; line-height: 28px; padding: 0 18px;
  color: #fff; font-weight: 600;
  background: var(--cs-btn-grad);
  border-radius: 999px;
  box-shadow: 0 3px 8px var(--cs-primary-light);
}
.m-card-grid .card .btn,
.m-list li .btn {
  color: #fff; font-weight: 600;
  background: var(--cs-btn-grad);
  border: none;
  box-shadow: 0 3px 8px var(--cs-primary-light);
}

/* ---------- 文章列表（攻略/资讯）：无下载按钮，纯图文行 ---------- */
.m-art-list li { align-items: center; }
.m-art-list .info { flex: 1; min-width: 0; }
.m-art-list .name { font-size: 15px; font-weight: 600; color: #1A1A1A; line-height: 1.45; }
.m-art-list .meta { margin-top: 5px; }

body.m-home,
body.m-list,
body.m-detail {
  padding-bottom: 60px;
}
