/* ============================================================
   EastMobile 清新绿 - 小心窝导航 3.0 官方手机版模板
   作者：小心窝  QQ:487276505
   ============================================================ */
:root {
  --pri: #10b981;
  --pri-deep: #059669;
  --pri-soft: #e7f7f0;
  --bg: #f4f6f5;
  --card: #ffffff;
  --t1: #1f2937;
  --t2: #6b7280;
  --t3: #9ca3af;
  --line: #eef1ef;
  --red: #f05b57;
  --orange: #ff943e;
  --blue: #3474f6;
  --radius: 14px;
  --hd-h: 52px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--t1); padding-bottom: 76px;
}
a { color: inherit; text-decoration: none; }
img { border: 0; max-width: 100%; }
ul, li { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; outline: none; border: none; background: none; }
code { background: var(--pri-soft); color: var(--pri-deep); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.hide { display: none !important; }

/* ===== 顶部 ===== */
.hd {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: var(--hd-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: env(safe-area-inset-top); height: calc(var(--hd-h) + env(safe-area-inset-top));
}
.hd .logo img { height: 30px; display: block; }
.hd .back { font-size: 26px; color: var(--t1); width: 30px; }
.hd-c { flex: 1; min-width: 0; display: flex; justify-content: center; }
.hd-c b { font-size: 17px; }
.searchbar {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: #f1f4f2; border-radius: 20px; padding: 8px 14px; color: var(--t3);
}
.searchbar input { flex: 1; color: var(--t1); background: none; }
.hd-r { font-size: 20px; color: var(--t1); padding: 4px 2px 4px 8px; cursor: pointer; }

/* 分类条 */
.chips {
  position: fixed; top: calc(var(--hd-h) + env(safe-area-inset-top)); left: 0; right: 0; z-index: 89;
  display: flex; gap: 8px; padding: 9px 14px; overflow-x: auto; white-space: nowrap;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line);
}
.chips a { flex-shrink: 0; padding: 5px 14px; border-radius: 16px; background: #f1f4f2; color: var(--t2); font-size: 13px; }
.chips a.on { background: var(--pri); color: #fff; font-weight: 600; }

/* ===== 页面主体 ===== */
.page { padding: calc(var(--hd-h) + env(safe-area-inset-top) + 52px) 12px 20px; }
.page.no-chips { padding-top: calc(var(--hd-h) + env(safe-area-inset-top) + 12px); }
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(16, 40, 32, .04);
}
.c-title { display: flex; align-items: center; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.c-title i { width: 4px; height: 16px; border-radius: 2px; background: var(--pri); margin-right: 8px; }
.c-title .more { margin-left: auto; font-size: 12px; color: var(--t3); font-weight: 400; }
.c-title .sub { margin-left: 8px; font-size: 12px; color: var(--t3); font-weight: 400; }

/* 公告 */
.notice { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(16,40,32,.04); }
.notice .label { flex-shrink: 0; color: var(--pri); font-weight: 700; font-size: 13px; }
.notice .scroll { flex: 1; overflow: hidden; height: 22px; position: relative; }
.notice .scroll p { position: absolute; width: 100%; animation: up 10s linear infinite; color: var(--t2); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
@keyframes up { 0%,12% { top: 0; } 50%,62% { top: -22px; } 100% { top: -44px; } }

/* 置顶横滑 */
.top-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.top-card { flex: 0 0 88px; text-align: center; padding: 12px 6px; border-radius: 12px; background: linear-gradient(160deg, #f2fbf7, #e9f6f0); position: relative; }
.top-card .ico { display: block; width: 42px; height: 42px; margin: 0 auto 6px; background: #fff; border-radius: 12px; box-shadow: 0 3px 8px rgba(5,150,105,.12); }
.top-card .ico img { width: 26px; height: 26px; margin: 8px; }
.top-card .nm { display: block; font-size: 12px; color: var(--t1); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-card .vw { display: block; font-size: 10px; color: var(--pri); margin-top: 3px; }

/* 站点宫格 */
.site-grid { display: grid; gap: 8px; }
.site-grid.col3 { grid-template-columns: repeat(3, 1fr); }
.site {
  display: flex; flex-direction: column; align-items: center; padding: 12px 4px 10px;
  background: #fafcfb; border: 1px solid var(--line); border-radius: 12px; position: relative; transition: .2s;
}
.site:active { transform: scale(.96); }
.site .ico { width: 38px; height: 38px; border-radius: 10px; background: #fff; box-shadow: 0 2px 6px rgba(16,40,32,.08); overflow: hidden; }
.site .ico img { width: 24px; height: 24px; margin: 7px; }
.site .nm { margin-top: 7px; font-size: 12px; color: var(--t1); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site .hot { position: absolute; top: -5px; right: -5px; background: var(--orange); color: #fff; font-size: 10px; font-style: normal; padding: 1px 6px; border-radius: 8px 8px 8px 0; }

/* ===== 详情页（按截图还原） ===== */
.head-card .head-flex { display: flex; gap: 12px; }
.head-card .thumb { flex: 0 0 108px; }
.head-card .thumb img { width: 108px; height: 78px; object-fit: cover; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.head-card .meta { flex: 1; min-width: 0; }
.head-card .nm { font-size: 17px; color: var(--pri); font-weight: 700; margin-bottom: 4px; }
.head-card .ds { font-size: 13px; color: var(--t2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.head-btns { display: flex; gap: 12px; margin-top: 14px; }
.btn { flex: 1; text-align: center; padding: 11px 0; border-radius: 10px; font-size: 15px; font-weight: 600; transition: .15s; }
.btn:active { transform: scale(.97); }
.btn.solid { background: var(--pri); color: #fff; box-shadow: 0 6px 14px rgba(16,185,129,.35); }
.btn.ghost { border: 1.5px solid var(--pri); color: var(--pri); background: #fff; }

.info-list li { display: flex; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-list li:last-child { border-bottom: 0; }
.info-list .k { color: var(--t1); flex-shrink: 0; }
.info-list .v { margin-left: auto; text-align: right; color: var(--t2); word-break: break-all; padding-left: 20px; }
.info-list .v.strong { color: var(--t1); font-weight: 600; }
.info-list .v .link { color: var(--pri); }
.stars i { color: #ffb400; font-size: 16px; margin-left: 2px; }

/* 权重徽章（仿截图） */
.w-badge { display: inline-flex; align-items: stretch; border-radius: 5px; overflow: hidden; font-size: 12px; vertical-align: middle; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.w-badge i, .w-badge b { display: block; padding: 2px 7px; font-style: normal; color: #fff; }
.w-badge.bd i { background: #2932e1; } .w-badge.bd b { background: #4a7cf6; }
.w-badge.sg i { background: #ea4335; } .w-badge.sg b { background: #f4735f; }
.w-badge.gg i { background: #1a73e8; } .w-badge.gg b { background: #34a853; }
.w-badge b { font-weight: 700; min-width: 18px; text-align: center; }

.ai-pass {
  display: flex; align-items: center; gap: 8px; background: linear-gradient(90deg, #e7f7f0, #f0faf5);
  border: 1px dashed var(--pri); color: var(--pri-deep); font-size: 12.5px;
  border-radius: 10px; padding: 9px 12px; margin-bottom: 12px;
}
.intro { font-size: 14px; color: var(--t2); line-height: 1.9; word-break: break-all; }
.intro.rich img { max-width: 100%; border-radius: 8px; }
.intro.rich p { margin-bottom: 8px; }
.tags { margin-top: 10px; }
.tags a { display: inline-block; background: var(--pri-soft); color: var(--pri-deep); font-size: 12px; padding: 3px 10px; border-radius: 10px; margin: 0 6px 6px 0; }
.trend { margin: 0 -4px; }
.trend-svg { width: 100%; height: auto; display: block; }

/* 榜单 */
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank { width: 20px; text-align: center; font-weight: 700; font-style: normal; color: var(--t3); font-size: 13px; }
.rank.r1 { color: #ff5c38; } .rank.r2 { color: #ff943e; } .rank.r3 { color: #ffb400; }
.rank-list .ico { width: 26px; height: 26px; border-radius: 7px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.rank-list .nm { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .vw { font-size: 12px; color: var(--t3); }

/* 文章列表 */
.art-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.art-list li:last-child { border: 0; }
.art-list .nm { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-list .tm { font-size: 12px; color: var(--t3); flex-shrink: 0; }

/* 友链云 */
.link-cloud a { display: inline-block; color: var(--t2); font-size: 13px; margin: 0 14px 8px 0; }

/* 数据条 */
.stats-strip { display: flex; text-align: center; }
.stats-strip > div { flex: 1; }
.stats-strip b { display: block; font-size: 18px; color: var(--pri); }
.stats-strip span { font-size: 11px; color: var(--t3); }

/* 分段器（Tab） */
.seg { display: flex; background: #e9eeeb; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px 0; border-radius: 9px; color: var(--t2); font-size: 14px; font-weight: 600; transition: .2s; }
.seg button.on { background: #fff; color: var(--pri-deep); box-shadow: 0 2px 6px rgba(0,0,0,.08); }

/* 表单 */
.tips { border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; line-height: 1.8; }
.tips.ok { background: var(--pri-soft); color: var(--pri-deep); }
.tips.info { background: #eef4ff; color: #3b6cd4; }
.f-group { margin-bottom: 14px; }
.f-group label { display: block; font-size: 13px; color: var(--t2); margin-bottom: 6px; }
.f-group input, .f-group select, .f-group textarea {
  width: 100%; background: #f6f8f7; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--t1);
}
.f-group input:focus, .f-group select:focus, .f-group textarea:focus { border-color: var(--pri); background: #fff; }
.f-group textarea { resize: vertical; font-size: 13px; line-height: 1.8; }
.f-row { display: flex; gap: 10px; align-items: center; }
.captcha { height: 42px; border-radius: 10px; cursor: pointer; }
.submit-btn {
  width: 100%; background: linear-gradient(90deg, var(--pri), #34d399); color: #fff;
  padding: 13px 0; border-radius: 12px; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 18px rgba(16,185,129,.35); cursor: pointer;
}
.submit-btn:active { transform: scale(.98); }

/* 分页 */
.em-pager { display: flex; justify-content: center; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.em-pager a, .em-pager span { min-width: 36px; text-align: center; padding: 8px 12px; border-radius: 10px; background: #fff; color: var(--t2); font-size: 13px; box-shadow: 0 1px 3px rgba(16,40,32,.05); }
.em-pager span.on, .em-pager a.on { background: var(--pri); color: #fff; font-weight: 700; }

/* 空状态 */
.empty { text-align: center; padding: 30px 0 20px; color: var(--t3); }
.empty i { font-size: 40px; margin-bottom: 10px; display: block; }
.empty a { color: var(--pri); font-size: 13px; }

/* ===== 底部栏 & tabbar ===== */
.ft { text-align: center; padding: 20px 16px 10px; color: var(--t3); font-size: 12px; line-height: 2; }
.ft .brand b { color: var(--t2); font-size: 14px; }
.ft a { color: var(--pri-deep); }
.ft .grey { opacity: .7; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 95; display: flex;
  background: rgba(255,255,255,.96); backdrop-filter: blur(14px); box-shadow: 0 -1px 0 var(--line);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; text-align: center; color: var(--t3); font-size: 10px; }
.tabbar a i { display: block; font-size: 19px; margin-bottom: 2px; }
.tabbar a.on { color: var(--pri); font-weight: 700; }

/* ===== 侧边抽屉 ===== */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 98; opacity: 0; pointer-events: none; transition: .25s; }
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: 82vw; max-width: 340px; z-index: 99;
  background: #fff; border-radius: 18px 0 0 18px; transform: translateX(105%); transition: transform .28s ease;
  overflow-y: auto; padding-bottom: 30px;
}
.drawer.show { transform: translateX(0); }
.dr-head { display: flex; align-items: center; gap: 12px; padding: 22px 16px 16px; background: linear-gradient(135deg, var(--pri), #34d399); color: #fff; border-radius: 0 0 24px 24px; position: relative; }
.dr-head .avatar { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.dr-head .tt b { display: block; font-size: 16px; }
.dr-head .tt span { font-size: 11px; opacity: .85; }
.dr-head .close { position: absolute; top: 14px; right: 14px; font-size: 18px; opacity: .9; cursor: pointer; }
.dr-sec { padding: 16px 16px 4px; }
.dr-sec h4 { font-size: 13px; color: var(--t2); margin-bottom: 10px; }
.dr-sec h4 small { color: var(--t3); font-weight: 400; margin-left: 6px; background: var(--pri-soft); color: var(--pri-deep); padding: 1px 6px; border-radius: 8px; }
.dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dr-grid a { display: flex; align-items: center; gap: 8px; background: #f6f8f7; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--t1); }
.dr-grid a i { color: var(--pri); }
.dr-sorts { display: flex; flex-wrap: wrap; gap: 8px; }
.dr-sorts a { background: #f6f8f7; color: var(--t2); font-size: 12px; padding: 5px 12px; border-radius: 14px; }

/* 模板广场 */
.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; transition: .2s; }
.tpl-item.active { border-color: var(--pri); background: #f4fbf8; }
.tpl-item img { width: 64px; height: 42px; object-fit: cover; border-radius: 8px; background: #f2f4f3; }
.tpl-item .info { flex: 1; min-width: 0; }
.tpl-item .info b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-item .info span { font-size: 11px; color: var(--t3); }
.tpl-item .use { flex-shrink: 0; font-size: 11px; padding: 4px 10px; border-radius: 12px; background: var(--pri); color: #fff; cursor: pointer; }
.tpl-item .use.on { background: var(--pri-soft); color: var(--pri-deep); cursor: default; }
.dr-foot { text-align: center; font-size: 11px; color: var(--t3); padding: 18px 0 8px; line-height: 1.9; }

/* 搜索浮层 */
.search-pop { position: fixed; inset: 0; z-index: 97; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: .2s; }
.search-pop.show { opacity: 1; pointer-events: auto; }
.sp-box { background: #fff; border-radius: 0 0 18px 18px; padding: 16px 14px 14px; }
.sp-box form { display: flex; gap: 10px; }
.sp-box input { flex: 1; background: #f1f4f2; border-radius: 10px; padding: 11px 14px; }
.sp-box button { color: var(--t2); padding: 0 6px; }
.sp-hot { margin-top: 10px; font-size: 12px; color: var(--t3); }
.sp-hot a { color: var(--t2); margin-left: 10px; }

/* 跳转页 */
.goto-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(160deg, #eafaf3, #d9f4e8); }
.goto-box { width: 86vw; max-width: 360px; background: #fff; border-radius: 20px; padding: 34px 24px; text-align: center; box-shadow: 0 18px 50px rgba(5,150,105,.18); }
.goto-box .ring { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%; background: var(--pri-soft); color: var(--pri); font-size: 32px; display: flex; align-items: center; justify-content: center; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.3); } 50% { box-shadow: 0 0 0 14px rgba(16,185,129,0); } }
.goto-box h3 { font-size: 17px; margin-bottom: 4px; }
.goto-box .target { color: var(--pri-deep); font-weight: 700; font-size: 15px; margin-bottom: 8px; word-break: break-all; }
.goto-box .tip { color: var(--t3); font-size: 13px; margin-bottom: 18px; }
.goto-box .btns { display: flex; gap: 12px; margin-bottom: 14px; }
.goto-box .warn { font-size: 11px; color: var(--orange); background: #fff7ee; border-radius: 8px; padding: 8px; }

/* 404 */
.e404 { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--t2); }
.e404 b { font-size: 64px; color: var(--pri); }
.e404 .btn { flex: none; padding: 10px 30px; margin-top: 16px; }

/* 分页容器（模板函数输出 li 列表） */
.pagination { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination li a, .pagination li span { display: inline-block; min-width: 36px; padding: 8px 12px; border-radius: 10px; background: #fff; color: var(--t2); font-size: 13px; text-align: center; }
.pagination li.active span { background: var(--pri); color: #fff; }

/* 桌面宽屏适配（手机版也可在平板正常显示） */
@media (min-width: 640px) {
  .page, .chips, .hd { max-width: 720px; margin-left: auto; margin-right: auto; }
  .hd, .chips, .tabbar { left: 50%; transform: translateX(-50%); width: 100%; }
  .hd { transform: translateX(-50%); }
}

/* 一键获取按钮 */
.fetch-btn {
  border: none; background: linear-gradient(135deg, var(--primary, #10b981), #0ea371); color: #fff;
  font-size: 14px; font-weight: 600; padding: 0 16px; border-radius: 10px; height: 42px; flex-shrink: 0;
}
.fetch-btn:disabled { opacity: .6; }

/* ===== 首页随机一言 ===== */
.em-hito{display:flex;align-items:flex-start;gap:8px;margin:10px 12px;padding:10px 14px;border-radius:10px;background:linear-gradient(135deg,#eefaf3,#f7fffb);color:#3a6b57;font-size:13px;line-height:1.7}
.em-hito i{color:#07c160;font-size:12px;margin-top:3px}
.em-hito span{flex:1;min-width:0}
