/* 前台手机版样式：深蓝顶栏 + 红色公益主题，宽屏时居中显示为 480px 手机宽度 */
:root {
  --blue: #0b2a7e;
  --blue2: #1a4fc4;
  --red: #d7191f;
  --gold: #ffe08a;
  --bg: #eef2f8;
  --text: #1d2433;
  --muted: #8a93a6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #d9e0ec;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.page {
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); overflow-x: hidden;
  display: flex; flex-direction: column;
}
.page > main { flex: 1; }

/* 顶栏 */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(180deg, #08226c, #12399f);
  color: #fff;
  box-shadow: 0 2px 10px rgba(5, 25, 80, .25);
}
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.logo {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; background: #fff; box-shadow: 0 0 0 1px rgba(233, 196, 106, .6);
}
.logo-text {
  border: 2px solid #e9c46a;
  display: grid; place-items: center; font-size: 20px; font-weight: 800; color: var(--blue);
  background: radial-gradient(circle, #fff 55%, #f3d27a);
}
.brand-name { min-width: 0; }
.brand-name b { display: block; font-size: 23px; line-height: 1.1; letter-spacing: 2px; white-space: nowrap; }
.brand-name small {
  display: block; margin-top: 3px; font-size: 8px; letter-spacing: .2px; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slogan {
  flex: none; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .55);
  position: relative; padding-bottom: 4px;
  font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: 1px; text-align: center; white-space: nowrap;
  color: #fff6dc;
}
/* 标语下方的红色笔刷线 */
.slogan::after {
  content: ""; position: absolute; left: 14px; right: 0; bottom: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, #e3262d 20%, #ff5a4f 70%, transparent);
  transform: rotate(-2deg);
}
.menu-btn {
  flex: none; width: 30px; height: 30px; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
}
.menu-btn i { display: block; height: 3px; border-radius: 2px; background: #fff; }
@media (max-width: 350px) { .slogan { display: none; } }

/* 侧边菜单 */
.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; transition: visibility .25s; }
.drawer.open { visibility: visible; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .25s; }
.drawer.open .drawer-mask { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 72%; max-width: 300px;
  background: #fff; overflow-y: auto; transform: translateX(100%); transition: transform .25s;
}
.drawer.open .drawer-panel { transform: none; }
.drawer-panel h3 {
  padding: calc(20px + env(safe-area-inset-top)) 18px 18px;
  background: linear-gradient(135deg, #08226c, #1a4fc4); color: #fff; font-size: 18px;
}
.drawer-panel a { display: block; padding: 14px 18px; border-bottom: 1px solid #f0f2f6; font-size: 15px; }

/* 轮播 */
.banner { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
/* 比例取自设计稿（576×200），保证不同屏宽下构图一致 */
.slide {
  position: relative; flex: 0 0 100%; aspect-ratio: 576 / 205; scroll-snap-align: start; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  padding: 5.5% 12px 0; text-align: center;
  background: center 62% / cover no-repeat, linear-gradient(180deg, #3f8ee2, #a9d3f5 55%, #fbe9c6 78%);
}
.slide-default:not([style])::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -34px; height: 74px;
  background: linear-gradient(90deg, #b5121b, #e8333a 50%, #b5121b);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.slide-big {
  position: relative; z-index: 1; font-size: 22px; font-weight: 900; line-height: 1.45; letter-spacing: 1.5px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  color: #9c0f15;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff,
    0 0 6px rgba(255, 236, 170, .9), 0 3px 4px rgba(10, 40, 120, .35);
}
.slide-sub {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #0b2a7e; text-shadow: 0 0 4px #fff, 0 0 2px #fff;
}
.slide-sub::before, .slide-sub::after { content: ""; width: 26px; height: 1px; background: #0b2a7e; }
.dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.dots i.on { background: #fff; }

/* 白色卡片 */
.card { margin: 12px 10px 0; background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(20, 40, 90, .06); }

/* 图标快捷入口 */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 14px; padding: 14px 0 12px; }
.quick a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.quick a:not(:nth-child(4n+1))::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: #e8ebf1;
}
.qicon {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 13px; color: #fff;
  background: var(--c);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c));
  box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 35%, transparent);
}
.qicon svg { width: 30px; height: 30px; }
/* 图片图标自带圆角底色，只保留投影 */
.qicon-img { background: none; overflow: hidden; }
.qicon-img img { width: 100%; height: 100%; object-fit: cover; }
.icon-text { font-style: normal; font-size: 26px; line-height: 1; }

/* 资讯标签 */
.news { padding: 2px 14px 6px; }
.tabs { display: flex; align-items: center; height: 44px; border-bottom: 1px solid #eef0f4; }
.tabs-scroll { flex: 1; min-width: 0; display: flex; align-items: center; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; height: 100%; padding: 0 16px; border: 0; background: none;
  font: inherit; font-size: 15px; color: #333; cursor: pointer; display: flex; align-items: center;
}
.tab:first-child { padding-left: 4px; }
.tab + .tab::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 16px; margin-top: -8px; background: #c9ced8; }
.tab.on { font-size: 18px; font-weight: 800; color: var(--blue2); }
.tab.on::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px; border-radius: 2px; background: var(--blue2); }
.tab.on:first-child::after { left: 4px; }
.more { flex: none; padding-left: 10px; font-size: 14px; font-weight: 600; color: #333; }
.news-list { display: none; list-style: none; }
.news-list.on { display: block; }
.news-list li a {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 0 8px 12px; border-bottom: 1px solid #f1f3f7; font-size: 13.5px;
}
.news-list li:last-child a { border-bottom: 0; }
.news-list li a::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: var(--red);
}
.news-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list time { flex: none; font-size: 12px; color: var(--muted); }
.empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 14px; list-style: none; }

/* 推广位 */
.promo {
  display: grid; place-items: center; aspect-ratio: 390 / 93; margin: 14px 10px 0; border-radius: 10px; overflow: hidden;
  background: var(--c, #d7191f); box-shadow: 0 4px 12px rgba(20, 40, 90, .12);
}
.promo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 未上传封面时用分类主题色兜底，保证推广位不塌陷 */
.promo-name { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: 2px; }

/* 图片分类卡片 */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 10px 0; }
.pcard { overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(20, 40, 90, .08); }
.pcard-img {
  display: grid; place-items: center; aspect-ratio: 184 / 92; color: var(--c);
  background: center / cover no-repeat,
    linear-gradient(145deg, color-mix(in srgb, var(--c) 18%, #fff), color-mix(in srgb, var(--c) 45%, #fff));
}
.pcard-img svg { width: 46px; height: 46px; }
.pcard-name {
  display: flex; align-items: center; justify-content: center; gap: 5px; height: 32px;
  background: var(--c); color: #fff; font-size: 14px; font-weight: 700;
}
.pcard-name svg { width: 18px; height: 18px; }
.pcard-name .icon-text { font-size: 15px; }

/* 页脚 */
/* 页脚图片只露出下半部分（山、城市、红丝带爱心），顶部渐变与页面底色衔接 */
.foot {
  position: relative; margin-top: 14px; aspect-ratio: 576 / 128;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  text-align: center; color: #fff; font-size: 11px; overflow: hidden;
  background: center bottom / 100% auto no-repeat, linear-gradient(180deg, var(--bg), #d4e3f6 45%, #fbe9c6 70%);
}
.foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 45%;
  background: linear-gradient(180deg, var(--bg), transparent);
}
.foot:not([style])::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: 0; height: 40%;
  background: linear-gradient(90deg, #b5121b, #e8333a 50%, #b5121b);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.foot p { position: relative; z-index: 1; opacity: .9; }

/* 列表页 */
.crumb { display: flex; align-items: center; gap: 6px; padding: 12px 14px 0; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--blue2); }
.list { padding: 4px 14px; }
.list-title {
  padding: 14px 0 12px 10px; border-bottom: 1px solid #eef0f4; font-size: 18px; position: relative;
}
.list-title::before { content: ""; position: absolute; left: 0; top: 17px; width: 4px; height: 18px; border-radius: 2px; background: var(--c); }
.item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f2f6; }
.item:last-child { border-bottom: 0; }
.item img { flex: none; width: 110px; height: 76px; border-radius: 8px; object-fit: cover; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item h3 { font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item p { font-size: 13px; color: #6b7385; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item time { margin-top: auto; font-size: 12px; color: var(--muted); }
.pin {
  display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 3px;
  font-size: 11px; font-style: normal; line-height: 18px; vertical-align: 2px; color: #fff; background: var(--red);
}
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 16px 0 0; font-size: 14px; }
.pager a { padding: 6px 16px; border-radius: 16px; background: #fff; color: var(--blue2); }
.pager span { padding: 6px 16px; color: #c0c5d0; }
.pager em { font-style: normal; color: var(--muted); }

/* 详情页 */
.article { padding: 18px 16px 22px; }
.article h1 { font-size: 21px; line-height: 1.45; }
.meta { display: flex; gap: 16px; margin: 10px 0 16px; padding-bottom: 14px; border-bottom: 1px solid #eef0f4; font-size: 12px; color: var(--muted); }
.content { font-size: 16px; line-height: 1.85; color: #2b3242; word-break: break-word; }
.content > * + * { margin-top: 12px; }
.content h2 { font-size: 18px; }
.content h3 { font-size: 16px; }
.content img { display: block; height: auto; margin: 12px auto; border-radius: 6px; }
.content .video-box { margin: 10px 0; border-radius: 6px; overflow: hidden; }
.content video, .content iframe { display: block; width: 100%; max-width: 100%; border: 0; border-radius: 6px; background: #000; }
.content iframe { aspect-ratio: 16 / 9; height: auto; }
.content a { color: var(--blue2); text-decoration: underline; }
.content ul, .content ol { padding-left: 22px; }
.content blockquote { padding: 8px 12px; border-left: 4px solid #dde3ee; background: #f6f8fc; color: #555; }
.related .tab.on { font-size: 17px; }

/* App 下载页 */
.download { padding: 28px 18px 24px; text-align: center; }
.dl-logo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 14px rgba(11, 42, 126, .25); }
.download h1 { margin: 12px 0 20px; font-size: 20px; }
.dl-btns { display: flex; flex-direction: column; gap: 12px; margin: 0 auto 6px; max-width: 280px; }
.dl-btn {
  display: block; height: 46px; line-height: 46px; border-radius: 23px;
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 1px;
}
.dl-btn.android { background: linear-gradient(90deg, #1f9d4c, #3cc46b); box-shadow: 0 4px 10px rgba(31, 157, 76, .3); }
.dl-btn.ios { background: linear-gradient(90deg, #1d2433, #3a4458); box-shadow: 0 4px 10px rgba(29, 36, 51, .3); }
.dl-btn.off { background: #e6e9ef; color: #9aa1b0; font-weight: 400; }
/* 当前设备对应的按钮放到最前，见 site.js */
.dl-btn.rec { order: -1; }
.download .content { margin-top: 20px; text-align: left; }

.notfound { padding: 50px 20px; text-align: center; }
.notfound b { display: block; font-size: 48px; color: var(--blue2); }
.notfound p { margin: 8px 0 18px; color: var(--muted); }
.notfound a { display: inline-block; padding: 8px 26px; border-radius: 20px; background: var(--red); color: #fff; }
