/* ===========================================================
   知料社 · 公众号 H5 落地页样式
   浅色主题 / 移动优先 / 微信内置浏览器兼容（不含 flex gap 之外的现代特性）
   =========================================================== */
:root {
  --page: #EFF1EE;
  --surface: #FFFFFF;
  --surface-2: #F7F9F7;
  --ink: #1A1E1B;
  --ink-2: #5B645E;
  --ink-3: #99A29C;
  --line: #E6EAE6;
  --green: #07A95C;
  --green-deep: #0A6C40;
  --green-soft: #E8F6EE;
  --amber: #E9A23B;
  --amber-soft: #FFF3DF;
  --red: #DD6152;
  --blue: #3E7BD6;
  --shadow: 0 2px 14px rgba(24, 46, 32, .06);
  --shadow-lg: 0 12px 40px rgba(20, 40, 28, .16);
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--green-deep); text-decoration: none; }

.device {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: 0 0 60px rgba(30, 50, 35, .08);
  position: relative;
  overflow: hidden;
}

/* ---------- 微信导航栏模拟 ---------- */
.wxbar {
  position: sticky; top: 0; z-index: 30;
  height: 48px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.wxbar__back { font-size: 28px; line-height: 1; width: 40px; color: var(--ink); }
.wxbar__title { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.wxbar__more { width: 40px; text-align: right; font-size: 20px; letter-spacing: 1px; color: var(--ink); }

.app { padding: 0 16px 120px; min-height: calc(100vh - 48px); }
.skeleton { padding-top: 30px; }
.skeleton div { height: 88px; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 12px; animation: pulse 1.4s ease-in-out infinite; }
.skeleton div:nth-child(2) { animation-delay: .12s; }
.skeleton div:nth-child(3) { animation-delay: .24s; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* ---------- 页面头 ---------- */
.page { animation: fadeUp .34s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.page-head { padding: 22px 2px 14px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .6px;
  color: var(--green-deep); background: var(--green-soft);
  padding: 4px 10px; border-radius: 20px; margin-bottom: 12px;
}
.eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.page-head h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.3; letter-spacing: -.4px; font-weight: 700; }
.page-head p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 20px; font-size: 12.5px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.is-active { background: var(--green-deep); color: #fff; border-color: var(--green-deep); }

/* ---------- 概览条 ---------- */
.statbar {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(115deg, #0E7A4B, #10A65C);
  color: #fff; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
  box-shadow: 0 8px 22px rgba(7, 120, 68, .18);
}
.statbar__main { font-size: 13px; opacity: .86; }
.statbar__num { font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }
.statbar__num small { font-size: 12px; font-weight: 500; opacity: .85; margin-left: 4px; }
.statbar__side { text-align: right; font-size: 11.5px; opacity: .82; line-height: 1.8; }
.statbar__date { display: inline-block; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: 2px 8px; }

/* ---------- 资源卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
  animation: fadeUp .36s ease both;
}
.card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 6px;
  background: var(--green-soft); color: var(--green-deep); font-weight: 600;
}
.tag--gray { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 3px 7px; border-radius: 5px; }
.badge--new { background: #FFEDE8; color: #D9583F; }
.badge--hot { background: var(--amber-soft); color: #B47716; }
.badge--top { background: #E9EFFB; color: var(--blue); }
.card h3 { margin: 0 0 7px; font-size: 16px; line-height: 1.45; font-weight: 650; letter-spacing: -.2px; }
.card p { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.card__meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 13px; }
.card__foot { display: flex; align-items: center; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 36px; padding: 0 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.96); }
.btn--primary { background: var(--green); color: #fff; flex: 1; }
.btn--ghost { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.btn--ghost.is-on { color: var(--red); background: #FFF1EF; border-color: #FFDCD7; }
.btn--wide { width: 100%; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12px; }

/* ---------- 榜单 ---------- */
.rank { position: relative; padding-left: 44px; }
.rank__no {
  position: absolute; left: 12px; top: 16px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: 12px; font-weight: 800;
  background: var(--surface-2); color: var(--ink-3);
}
.rank--1 .rank__no { background: #FFF0D4; color: #B47716; }
.rank--2 .rank__no { background: #EEF1F4; color: #6D7A88; }
.rank--3 .rank__no { background: #FBEDE3; color: #B57953; }

/* ---------- 分类网格 ---------- */
.catgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.catcard {
  border: 1px solid var(--line); border-radius: 14px; padding: 15px 14px;
  background: var(--surface); box-shadow: var(--shadow); text-align: left;
  animation: fadeUp .34s ease both;
}
.catcard:active { transform: scale(.98); }
.catcard__icon {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 11px;
}
.catcard__name { font-size: 14.5px; font-weight: 650; margin-bottom: 3px; }
.catcard__desc { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.catcard__count { font-size: 11px; color: var(--green-deep); margin-top: 9px; font-weight: 600; }

/* ---------- 搜索 ---------- */
.searchbox {
  display: flex; align-items: center; gap: 9px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; height: 44px; margin-bottom: 16px;
}
.searchbox input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; }
.searchbox__clear { color: var(--ink-3); font-size: 18px; padding: 0 4px; }
.hotwords { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.hotword { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px; font-size: 12px; color: var(--ink-2); }
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty__icon { font-size: 34px; margin-bottom: 10px; opacity: .65; }
.empty__title { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.empty__desc { font-size: 12px; line-height: 1.7; }

/* ---------- 领取记录时间线 ---------- */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 12px; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 19px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--green); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--green-soft);
}
.tl-date { font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.claim { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 14px; box-shadow: var(--shadow); }
.claim__title { font-size: 14px; font-weight: 600; line-height: 1.45; margin-bottom: 8px; }
.claim__token {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface-2); border: 1px dashed #CFD8D1; border-radius: 8px;
  padding: 9px 11px; margin-bottom: 10px;
}
.claim__code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; letter-spacing: .5px; color: var(--green-deep); }
.claim__acts { display: flex; gap: 8px; }
.claim__acts .btn { flex: 1; }
.status { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: var(--green-soft); color: var(--green-deep); font-weight: 600; }
.status--expired { background: #FFF1EF; color: var(--red); }

/* ---------- 说明型页面 ---------- */
.notice {
  background: var(--green-soft); border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: 12.5px; color: var(--green-deep);
  line-height: 1.7; margin-bottom: 18px;
}
.notice--amber { background: var(--amber-soft); border-left-color: var(--amber); color: #8A5C10; }
.section-title { font-size: 15px; font-weight: 700; margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--green); }

.step { display: flex; gap: 13px; margin-bottom: 14px; }
.step__no {
  flex: 0 0 27px; height: 27px; border-radius: 9px; background: var(--green-deep); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.step__body { flex: 1; padding-top: 1px; }
.step__title { font-size: 14.5px; font-weight: 650; margin-bottom: 4px; }
.step__desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

.faq { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.faq__q { padding: 13px 14px; font-size: 13.5px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.faq__q span:last-child { color: var(--ink-3); font-size: 16px; }
.faq__a { padding: 0 14px 13px; font-size: 12.5px; color: var(--ink-2); line-height: 1.75; display: none; }
.faq.is-open .faq__a { display: block; }
.faq.is-open .faq__q span:last-child { transform: rotate(45deg); }

/* 口令动效演示（可替换为真实 GIF） */
.gif-demo {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2);
  margin-bottom: 16px;
}
.gif-demo__screen {
  height: 168px; position: relative; padding: 16px;
  background: linear-gradient(160deg, #F4F8F5, #EAF3EC);
}
.phone-mock { width: 132px; height: 142px; margin: 0 auto; background: #fff; border: 4px solid #26302A; border-radius: 14px; padding: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.phone-mock__bar { height: 6px; width: 40px; border-radius: 4px; background: #DDE4DE; margin: 0 auto 10px; }
.phone-mock__line { height: 7px; border-radius: 4px; background: #EDF1ED; margin-bottom: 7px; }
.phone-mock__line.short { width: 60%; }
.phone-mock__popup {
  margin-top: 10px; background: var(--green-soft); border: 1px solid #BFE5CE; border-radius: 8px;
  padding: 8px; font-size: 9.5px; color: var(--green-deep); text-align: center;
  opacity: 0; transform: translateY(6px); transition: all .3s ease;
}
.phone-mock__popup.show { opacity: 1; transform: none; }
.gif-demo__caption { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: #fff; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); }
.gif-demo__dots { display: flex; gap: 5px; }
.gif-demo__dots i { width: 5px; height: 5px; border-radius: 50%; background: #D8DED9; }
.gif-demo__dots i.on { background: var(--green); }

/* 订阅页 */
.sub-hero { text-align: center; padding: 18px 10px 22px; }
.sub-hero__icon {
  width: 62px; height: 62px; border-radius: 20px; background: var(--green-soft);
  display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 14px;
}
.sub-hero h2 { margin: 0 0 7px; font-size: 18px; }
.sub-hero p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.subscribe-slot { margin: 4px 0 18px; text-align: center; }
.subscribe-slot wx-open-subscribe { display: block; }
.subscribe-btn { width: 100%; height: 46px; border-radius: 11px; background: var(--green); color: #fff; font-size: 15px; font-weight: 650; }
.sub-rule { background: var(--surface-2); border-radius: 12px; padding: 14px; font-size: 12px; color: var(--ink-2); line-height: 1.85; }
.sub-rule b { color: var(--ink); }

/* 数据看板 */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; }
.kpi__num { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.kpi__label { font-size: 11.5px; color: var(--ink-3); }
.bar-row { margin-bottom: 12px; }
.bar-row__top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar-row__top span:last-child { color: var(--ink-3); }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green)); border-radius: 5px; transition: width .5s ease; }
.event-log { font-size: 11.5px; color: var(--ink-2); }
.event-log div { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; }
.event-log time { color: var(--ink-3); white-space: nowrap; }

/* ---------- 菜单模拟器 ---------- */
.menu-sim {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(430px, 100%); z-index: 40;
}
.menu-sim__bar {
  height: 54px; display: flex; align-items: stretch;
  background: #F7F8F7; border-top: 1px solid #DFE3DF;
  padding-bottom: env(safe-area-inset-bottom);
}
.menu-sim__bar button {
  flex: 1; font-size: 13px; font-weight: 600; color: #3A423C;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-right: 1px solid #E7EAE7; position: relative;
}
.menu-sim__bar button:last-child { border-right: 0; }
.menu-sim__bar button.is-active { color: var(--green-deep); }
.menu-sim__bar button.is-active::after {
  content: ""; position: absolute; top: 6px; left: 50%; width: 4px; height: 4px;
  border-radius: 50%; background: var(--green); transform: translateX(-50%);
}
.menu-sim__ico { font-size: 15px; opacity: .8; }
.menu-sim__panel {
  background: #F7F8F7; border-top: 1px solid #DFE3DF;
  box-shadow: 0 -8px 24px rgba(20,40,28,.08);
  animation: fadeUp .2s ease both;
}
.menu-sim__panel-head { padding: 9px 16px 5px; font-size: 11px; color: var(--ink-3); }
.menu-sim__panel button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 12px 18px; background: #fff; border-bottom: 1px solid #EFF1EF;
  font-size: 13.5px; text-align: left; color: var(--ink);
}
.menu-sim__panel button:first-of-type { border-top: 1px solid #EFF1EF; }
.menu-sim__panel button span:last-child { color: var(--ink-3); font-size: 12px; }
.menu-sim__panel button kbd { font: inherit; font-size: 10px; color: var(--ink-3); background: var(--surface-2); padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.menu-sim__mask { position: fixed; inset: 0; background: rgba(20,30,24,.18); z-index: 35; }

/* 渠道标签 */
.channel-tag {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 0 12px;
  font-size: 10.5px; color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px;
  font-family: ui-monospace, Menlo, monospace;
}
.channel-tag b { color: var(--green-deep); font-weight: 600; }

/* ---------- Toast / Modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(24,32,27,.92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 10px; z-index: 100;
  opacity: 0; pointer-events: none; transition: all .24s ease; max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal__mask { position: absolute; inset: 0; background: rgba(16,24,19,.45); }
.modal__body {
  position: relative; width: min(430px, 100%); background: #fff;
  border-radius: 20px 20px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: slideUp .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes slideUp { from { transform: translateY(100%) } to { transform: none } }
.modal__title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.modal__sub { font-size: 12.5px; color: var(--ink-2); margin: 0 0 18px; line-height: 1.7; }
.token-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--green-soft); border: 1px dashed #A9DCC0; border-radius: 12px;
  padding: 15px 14px; margin-bottom: 12px;
}
.token-box__code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 17px; font-weight: 700; color: var(--green-deep); letter-spacing: .6px; }
.token-box__label { font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.modal__actions { display: flex; gap: 9px; margin-top: 16px; }
.modal__actions .btn { flex: 1; }
.modal__tip { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.footer-note { text-align: center; color: var(--ink-3); font-size: 11px; padding: 24px 0 8px; line-height: 1.8; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.link-row a { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; font-size: 12px; }
