/* 噜噜表情包 · bqb.rej.cc
 * 移动端优先，微信内置浏览器 / Safari / Chrome 通用。
 * 配色全部走 CSS 变量：换主题只需叠加一个 theme-*.css，不用改这份文件。
 */

:root {
  --brand: #3D6BFF;
  --brand-2: #6E8FFF;
  --accent: #FF6B3D;
  --ink: #141A2C;
  --sub: #6C7488;
  --line: #E8ECF6;
  --bg: #F5F7FC;
  --card: #FFFFFF;
  --radius: 18px;
  --cell-radius: 14px;
  --shadow: 0 6px 22px rgba(20, 26, 44, .07);
  --dock-h: 66px;

  /* 以下给主题覆盖用 */
  --hero-grad: linear-gradient(155deg, #3D6BFF 0%, #5B7EFF 46%, #8FA9FF 100%);
  --hero-shadow: 0 14px 34px rgba(61, 107, 255, .28);
  --hero-fg: #FFFFFF;
  --hero-fg-dim: rgba(255, 255, 255, .88);
  --topbar-bg: rgba(245, 247, 252, .88);
  --dock-bg: rgba(255, 255, 255, .94);
  --notice-bg: #FFF6EE;
  --notice-fg: #A7571F;
  --notice-line: #FFE3C9;
  --notice-strong: #C24A12;
  --cell-bg: #FFFFFF;
  --lb-bg: rgba(8, 10, 18, .94);
  --foot-fg: #9AA2B4;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 14px);
}
img { display: block; max-width: 100%; border: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 14px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand img { width: 28px; height: 28px; border-radius: 9px; }
.topbar-cta {
  font-size: 13px; font-weight: 700; color: var(--brand);
  background: var(--card); border: 1px solid var(--line); padding: 6px 13px; border-radius: 999px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: 14px 0 0; padding: 22px 18px 20px;
  border-radius: 22px; color: var(--hero-fg);
  background: var(--hero-grad);
  box-shadow: var(--hero-shadow);
}
.hero::after {
  content: ""; position: absolute; right: -46px; top: -56px;
  width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, .13);
}
.hero::before {
  content: ""; position: absolute; right: 34px; bottom: -60px;
  width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .09);
}
.hero h1 { position: relative; margin: 0 0 6px; font-size: 26px; line-height: 1.25; letter-spacing: .5px; }
.hero p { position: relative; margin: 0 0 16px; font-size: 13px; color: var(--hero-fg-dim); }
.hero .row { position: relative; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; border-radius: 999px; padding: 11px 18px; font-size: 15px;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-white { background: #fff; color: var(--brand); box-shadow: 0 8px 18px rgba(15, 25, 70, .18); }
.btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .42); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgba(255, 107, 61, .34); }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 12px 0 0; padding: 10px 12px;
  border-radius: 12px; font-size: 12.5px; line-height: 1.5;
  background: var(--notice-bg); color: var(--notice-fg); border: 1px solid var(--notice-line);
}
.notice b { color: var(--notice-strong); }

/* ---------- 分类 ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  background: var(--card); color: var(--sub); font-size: 13.5px;
  border: 1px solid var(--line); white-space: nowrap;
  transition: .15s ease;
}
.tab span { opacity: .55; font-size: 12px; }
.tab.on {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 6px 14px rgba(61, 107, 255, .26);
}
.tab.on span { opacity: .8; }

/* ---------- 表情网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 430px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.cell {
  position: relative; display: block; width: 100%; min-width: 0;
  aspect-ratio: 1 / 1; border-radius: var(--cell-radius); overflow: hidden;
  background: var(--cell-bg); border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(20, 26, 44, .04);
  transition: transform .12s ease;
}
.cell:active { transform: scale(.96); }
.cell img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cell .badge {
  position: absolute; left: 6px; top: 6px;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: rgba(255, 107, 61, .14); color: #D24A1C;
}

/* 老版本 WebView 没有 aspect-ratio，用 padding 撑高 */
@supports not (aspect-ratio: 1 / 1) {
  .cell::before { content: ""; display: block; padding-top: 100%; }
  .cell img { position: absolute; left: 0; top: 0; }
  .cell .badge { z-index: 2; }
}

.empty { padding: 40px 0; text-align: center; color: var(--sub); font-size: 13.5px; }

.more {
  display: block; width: 100%; margin: 14px 0 0; padding: 12px;
  border-radius: 14px; background: var(--card); border: 1px dashed var(--line);
  color: var(--brand); font-weight: 600; font-size: 14px;
}

/* ---------- 点我下载卡（动图） ---------- */
.cta-card {
  display: block; margin: 16px 0 0; padding: 10px 10px 16px;
  border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  text-align: center;
}
.cta-card img { width: 100%; border-radius: 12px; display: block; }
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 12px; padding: 12px 28px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 10px 24px rgba(255, 107, 61, .34);
  animation: ctaPulse 1.6s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

/* ---------- 卡片 ---------- */
.card {
  margin: 16px 0 0; padding: 16px;
  border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.card-title { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.card-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--sub); }

.follow { display: flex; gap: 14px; align-items: center; }
.follow img { width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--line); flex: 0 0 auto; }
.follow .txt { flex: 1; min-width: 0; }
.follow .txt b { display: block; font-size: 15px; margin-bottom: 2px; }
.copy-btn {
  margin-top: 8px; display: inline-block; font-size: 12.5px; font-weight: 700;
  color: var(--brand); background: rgba(61, 107, 255, .1); border-radius: 999px; padding: 5px 12px;
}

.box-card { display: flex; gap: 14px; align-items: center; }
.box-card .logo { width: 56px; height: 56px; border-radius: 16px; flex: 0 0 auto; box-shadow: 0 6px 16px rgba(61, 107, 255, .22); }
.box-card .txt { flex: 1; min-width: 0; }
.box-card .txt b { display: block; font-size: 15.5px; }
.box-card .txt span { font-size: 12.5px; color: var(--sub); }
.box-card .btn { padding: 9px 14px; font-size: 13.5px; flex: 0 0 auto; }

/* ---------- 底部固定下载条 ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px));
  background: var(--dock-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.dock .info { flex: 1; min-width: 0; font-size: 11.5px; color: var(--sub); line-height: 1.35; }
.dock .info b { display: block; font-size: 14px; color: var(--ink); }
.dock .btn { flex: 0 0 auto; padding: 10px 20px; font-size: 14.5px; }

/* ---------- 大图预览 ---------- */
.lb {
  position: fixed; inset: 0; z-index: 60;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 20px; background: var(--lb-bg);
}
.lb.on { display: flex; }
.lb img {
  max-width: min(78vw, 340px); max-height: 56vh;
  border-radius: 16px; background: #fff; padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.lb .name { color: #fff; font-size: 15px; font-weight: 700; }
.lb .hint { color: rgba(255, 255, 255, .9); font-size: 13px; text-align: center; margin-top: -6px; }
.lb .hint b { color: #FFD36B; }
.lb .actions { display: flex; gap: 10px; }
.lb .close {
  position: absolute; right: 14px; top: calc(14px + env(safe-area-inset-top, 0px));
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; line-height: 1;
}

/* ---------- 提示气泡 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%) translateY(10px);
  z-index: 80; max-width: 86vw; padding: 9px 16px; border-radius: 999px;
  background: rgba(20, 26, 44, .93); color: #fff; font-size: 13px; text-align: center;
  opacity: 0; pointer-events: none; transition: .24s ease;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 页脚 ---------- */
.foot { margin: 22px 0 6px; color: var(--foot-fg); font-size: 11.5px; text-align: center; line-height: 1.9; }
.foot a { color: var(--foot-fg); border-bottom: 1px dotted currentColor; }
.foot p { margin: 0; }

/* ================= 下载页 ================= */
.down-main { padding-top: 22px; text-align: center; }
.down-main .card { text-align: left; }
.down-logo { width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 24px; box-shadow: 0 16px 34px rgba(61, 107, 255, .25); }
.down-main h1 { margin: 0 0 6px; font-size: 23px; letter-spacing: .5px; }
.down-main .sub { margin: 0 0 22px; font-size: 13.5px; color: var(--sub); }

.dl-btn {
  display: block; width: 100%; padding: 17px;
  border-radius: 16px; background: var(--accent); color: #fff;
  font-size: 17px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 14px 30px rgba(255, 107, 61, .36);
  transition: transform .12s ease;
}
.dl-btn:active { transform: scale(.98); }
.dl-note { margin-top: 10px; font-size: 12px; color: var(--sub); }

.dl-second { margin-top: 12px; display: flex; gap: 10px; }
.dl-second .btn { flex: 1; padding: 12px; font-size: 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }

.wx-bar {
  display: none; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 10px 12px; border-radius: 12px;
  background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-fg); font-size: 12.5px; text-align: left;
}
.wx-bar.on { display: flex; }
.wx-bar b { color: var(--notice-strong); }

.steps { margin: 18px 0 0; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-align: left; }
.steps h2 { margin: 0 0 10px; font-size: 14.5px; }
.steps li { position: relative; padding-left: 26px; margin-bottom: 8px; font-size: 13px; color: var(--sub); }
.steps li b { color: var(--ink); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(61, 107, 255, .12); color: var(--brand); font-size: 11px; font-weight: 700;
  line-height: 18px; text-align: center;
}
.steps ol { counter-reset: step; }

/* 微信内引导遮罩 */
.sheet {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: #06080e; color: #fff;
  padding: 26px 24px; overflow-y: auto;
}
.sheet.on { display: block; }
.sheet .arrow {
  position: absolute; right: 14px; top: 6px;
  font-size: 46px; line-height: 1; color: #FFD36B;
}
.sheet .tip { margin: 92px auto 0; max-width: 300px; font-size: 15px; line-height: 1.9; }
.sheet .tip b { color: #FFD36B; }
.sheet .tip ol { counter-reset: s2; margin-top: 10px; }
.sheet .tip li { position: relative; padding-left: 30px; font-size: 14.5px; color: rgba(255, 255, 255, .92); margin-bottom: 10px; }
.sheet .tip li::before {
  counter-increment: s2; content: counter(s2);
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255, 211, 107, .2); color: #FFD36B;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.sheet .close2 {
  position: absolute; left: 50%; bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 10px 26px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 14px;
}
.sheet-logo {
  display: block; width: 84px; height: 84px; margin: 54px auto 0;
  border-radius: 24px; opacity: .95;
  box-shadow: 0 20px 46px rgba(61, 107, 255, .32);
}
.sheet-foot {
  margin: 14px 0 0; text-align: center;
  color: rgba(255, 255, 255, .5); font-size: 12.5px;
}

/* ---------- 随动二维码 ---------- */
.qr-fab {
  position: fixed; right: 14px; z-index: 45;
  bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 14px);
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 7px; border-radius: 999px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(20, 26, 44, .16);
  text-align: left;
}
.qr-fab img { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); }
.qr-fab b { display: block; font-size: 12.5px; line-height: 1.25; }
.qr-fab small { display: block; font-size: 10.5px; color: var(--sub); line-height: 1.3; }

.qr-modal {
  position: fixed; inset: 0; z-index: 85;
  display: none; align-items: center; justify-content: center;
  padding: 26px; background: rgba(8, 10, 18, .9);
}
.qr-modal.on { display: flex; }
.qr-modal .box {
  width: 100%; max-width: 320px;
  padding: 22px 20px 18px; border-radius: 20px;
  background: #fff; text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.qr-modal .box img { width: 100%; max-width: 236px; margin: 0 auto 14px; border-radius: 10px; }
.qr-modal .box b { display: block; font-size: 16px; color: #141A2C; }
.qr-modal .box p { margin: 6px 0 14px; font-size: 12.5px; line-height: 1.6; color: #6C7488; }
.qr-close {
  position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top, 0px));
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 17px;
}

.qr-side { display: none; }
@media (min-width: 900px) {
  .qr-fab { display: none; }
  .qr-side {
    display: block; position: fixed; right: 28px; bottom: calc(var(--dock-h) + 22px); z-index: 45;
    width: 178px; padding: 14px 14px 12px; border-radius: 18px;
    background: var(--card); border: 1px solid var(--line);
    box-shadow: 0 16px 38px rgba(20, 26, 44, .14);
    text-align: center;
  }
  .qr-side img { width: 150px; height: 150px; margin: 0 auto 10px; border-radius: 8px; }
  .qr-side b { display: block; font-size: 13px; }
  .qr-side span { display: block; margin-top: 2px; font-size: 11px; color: var(--sub); }
}

/* 宽屏时顶栏和底栏跟着 560 的内容列走，不要贴到屏幕两边 */
@media (min-width: 640px) {
  .topbar, .dock {
    padding-left: max(14px, calc(50% - 280px));
    padding-right: max(14px, calc(50% - 280px));
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
