/* 站点统一清爽视觉 · 手机版
   浅色底、轻阴影、大留白；所有封面由 /api/cover/:id 本地生成，不引用外部图片 */
:root {
  --brand: #4f6bff;
  --brand2: #8a63ff;
  --brand-soft: #eef2ff;
  --ink: #1d2438;
  --sub: #5b6479;
  --muted: #8a93a8;
  --line: #edf0f7;
  --bg: #f6f8fc;
  --card: #ffffff;
  --warm: #ff7a45;
  --money: #e0483f;
  --shadow: 0 6px 22px rgba(38, 54, 96, .055);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
body.has-tabbar { padding-bottom: 78px; }
.vip-wrap { max-width: 620px; margin: 0 auto; padding: 0 16px 28px; }

/* ── 统一顶部条 ── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { font-size: 19px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(100deg, var(--brand), var(--brand2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 2px;
  color: var(--muted); -webkit-text-fill-color: var(--muted); }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft);
  color: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
}
.icon-btn:active { transform: scale(.94); }

/* 老版顶栏样式：后台页仍在用；前台页由 chrome.js 自动移除并换成统一顶栏 */
.vip-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; }
.vip-brand { font-size: 17px; font-weight: 800; color: var(--brand); }
.vip-topbar .mini { font-size: 12px; color: var(--muted); }

/* ── 底部五格导航 ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 66px; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; box-shadow: 0 -6px 22px rgba(38,54,96,.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; color: #a2aabd; }
.tabbar a .ico { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .55; }
.tabbar a.active { color: var(--brand); font-weight: 700; }
.tabbar a.active .ico { filter: none; opacity: 1; }

/* ── 首页 hero ── */
.hero {
  margin-top: 16px; border-radius: 22px; padding: 24px 22px 20px;
  background: linear-gradient(125deg, #5876ff 0%, #7b62f5 55%, #9a7bf0 100%);
  color: #fff; box-shadow: 0 12px 30px rgba(79,107,255,.22);
  position: relative; overflow: hidden;
}
.hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255,255,255,.11); }
.hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: .5px; position: relative; }
.hero p { margin: 0 0 16px; font-size: 13px; opacity: .88; position: relative; }
.hero-search { display: flex; background: #fff; border-radius: 14px; padding: 5px 5px 5px 16px;
  align-items: center; position: relative; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.hero-search input { flex: 1; border: none; outline: none; font-size: 15px; font-family: inherit;
  color: var(--ink); background: transparent; min-width: 0; }
.hero-search button { border: none; background: var(--brand); color: #fff; font-family: inherit;
  font-size: 14px; font-weight: 700; padding: 9px 18px; border-radius: 10px; cursor: pointer; }

/* ── 快捷双卡 / 分类横滑 ── */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 6px; }
.quick-card { background: var(--card); border-radius: 18px; padding: 20px 12px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid rgba(237,240,247,.9); }
.quick-card .q-ico { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand); display: flex; align-items: center;
  justify-content: center; font-size: 23px; }
.quick-card:nth-child(2) .q-ico { background: #fff0e8; color: var(--warm); }
.quick-card b { display: block; font-size: 15px; }
.quick-card span { font-size: 11px; color: var(--muted); }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: #fff; border: 1px solid var(--line); color: var(--sub);
  border-radius: 999px; padding: 7px 15px; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ── 商品卡片（两列，封面自动生成）── */
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.res-list { display: flex; flex-direction: column; gap: 12px; }
.res-card {
  display: block; background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(237,240,247,.9);
  transition: transform .18s, box-shadow .18s;
}
.res-card:active { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(38,54,96,.11); }
.res-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--brand-soft); overflow: hidden; }
.res-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vip-chip { position: absolute; left: 8px; top: 8px; background: rgba(79,107,255,.94); color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.res-body { padding: 11px 12px 12px; }
.res-body h3 { margin: 0 0 5px; font-size: 14px; font-weight: 700; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.res-body p { margin: 0 0 8px; font-size: 11px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.res-foot { display: flex; align-items: baseline; justify-content: space-between; }
.res-price { color: var(--money); font-weight: 800; font-size: 16px; }
.res-foot .go { font-size: 11px; color: var(--brand); font-weight: 700; }

/* 旧版横排卡片（兼容 admin 之外残留页面） */
.res-item { display: flex; gap: 12px; background: #fff; border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow); align-items: flex-start; }
.res-cover { width: 104px; height: 84px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--brand-soft); display: flex; align-items: center; justify-content: center; }
.res-cover img { width: 100%; height: 100%; object-fit: cover; }
.res-main { flex: 1; min-width: 0; }
.res-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.res-desc { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.res-foot { justify-content: space-between; }
.res-free { color: var(--brand); font-size: 13px; font-weight: 700; }

/* ── 标题 / 卡片 ── */
.section-label { font-size: 18px; font-weight: 800; margin: 24px 0 12px; display: flex;
  align-items: center; justify-content: space-between; }
.section-label .more { font-size: 12px; color: var(--muted); font-weight: 500; }
.page-head { text-align: center; padding: 28px 0 18px; }
.page-head h1 { font-size: 27px; font-weight: 800; margin: 0 0 6px; letter-spacing: 1px; }
.page-head p { font-size: 13px; color: var(--muted); margin: 0; }
.faq-card { background: var(--card); border-radius: 16px; padding: 18px 20px; margin: 12px 0;
  box-shadow: var(--shadow); }
.faq-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.faq-card p { font-size: 13px; color: var(--sub); margin: 0; line-height: 1.75; }
.notice { background: #fff8e8; color: #8a6014; font-size: 13px; padding: 9px 16px;
  text-align: center; border-bottom: 1px solid #ffecbe; }

/* ── 套餐卡片 ── */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card { position: relative; background: #fff; border: 2px solid var(--brand);
  border-radius: 20px; padding: 24px 16px 18px; margin: 22px 0; box-shadow: 0 10px 28px rgba(79,107,255,.12); }
.plan-grid .plan-card { margin: 0; }
.plan-card.plain { border-color: var(--line); box-shadow: var(--shadow); }
.plan-card.alt { border-color: #e3dcff; box-shadow: 0 10px 28px rgba(138,99,255,.12); }
.plan-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(100deg, var(--brand), var(--brand2)); color: #fff; font-size: 11px;
  font-weight: 700; padding: 4px 16px; border-radius: 999px; white-space: nowrap; }
.plan-title { text-align: center; font-size: 17px; font-weight: 700; margin: 4px 0 8px; }
.plan-price { text-align: center; font-size: 18px; font-weight: 700; color: var(--money); margin-bottom: 4px; }
.plan-price b { font-size: 42px; font-weight: 800; letter-spacing: -2px; }
.plan-sub { text-align: center; color: var(--sub); font-size: 12px; margin: 0 0 16px; }
.rights { list-style: none; margin: 0 0 18px; padding: 0; }
.rights li { border-top: 1px solid var(--line); padding: 10px 2px; color: var(--sub); font-size: 12px; }
.rights li:last-child { border-bottom: 1px solid var(--line); }
.rights li::before { content: '✓'; color: var(--brand); font-weight: 800; margin-right: 6px; }
.btn-vip { display: block; width: 100%; text-align: center; border: none; border-radius: 13px;
  padding: 13px; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
  background: linear-gradient(100deg, var(--brand), var(--brand2)); color: #fff;
  box-shadow: 0 6px 18px rgba(79,107,255,.24); }
.btn-vip:hover { filter: brightness(1.05); }
.btn-vip:disabled { opacity: .55; cursor: default; }
.btn-outline { display: block; width: 100%; text-align: center; background: #fff; color: var(--brand);
  border: 1px solid #c9d4ff; border-radius: 13px; padding: 13px; font-size: 15px; font-weight: 600; }

/* ── 会员状态 / 我的 ── */
.vip-status, .me-card, .auth-box { background: #fff; border-radius: 18px; padding: 20px;
  margin: 14px 0; box-shadow: var(--shadow); }
.status-head, .me-head { display: flex; align-items: center; gap: 13px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.status-avatar, .me-avatar { width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg,#ffc46b,#ff7a45); display: flex; align-items: center;
  justify-content: center; font-size: 25px; }
.me-avatar { background: var(--brand-soft); }
.status-head h3 { margin: 0 0 2px; font-size: 17px; font-weight: 700; }
.status-head p { margin: 0; font-size: 12px; color: var(--muted); }
.status-box { background: var(--brand-soft); border-radius: 13px; text-align: center; padding: 12px; margin: 10px 0; }
.status-box .num { font-size: 27px; font-weight: 800; color: var(--brand); }
.status-box .lbl { font-size: 12px; color: var(--muted); }
.vip-status .btn-vip { max-width: 200px; margin: 8px auto 0; }
.vip-badge { display: inline-block; background: linear-gradient(100deg,#ffab3d,#ff7043); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 12px; border-radius: 999px; }
.vip-badge.off { background: #e9edf4; color: var(--muted); }
.me-name { font-size: 17px; font-weight: 700; }
.me-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.me-menu a, .me-menu button { background: #f7f9fd; border: none; border-radius: 11px; padding: 11px;
  font-size: 13px; color: var(--sub); text-align: center; font-family: inherit; cursor: pointer; }
.me-menu a.hi { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.me-logout { display: block; margin: 16px auto 0; background: none; border: none; color: #e14a4a;
  font-size: 13px; cursor: pointer; }

/* ── 表单 / 分类 ── */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tabs button { flex: 1; background: #f3f6fd; border: none; border-radius: 11px; padding: 10px;
  font-size: 14px; font-weight: 600; color: var(--sub); font-family: inherit; cursor: pointer; }
.auth-tabs button.on { background: var(--brand); color: #fff; }
.auth-box .btn-vip { margin-top: 16px; }
.auth-tip { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat-item { background: #fff; border-radius: 16px; padding: 18px 10px; text-align: center;
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.cat-item .ico { display: block; font-size: 26px; margin-bottom: 6px; }

/* ── 详情页 ── */
.detail-box { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.detail-hero { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--brand-soft); margin-bottom: 18px; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-title { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.detail-meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.detail-desc { white-space: pre-wrap; color: var(--sub); font-size: 14px; line-height: 1.8; }
.access-note { background: #f7f9fd; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 12px; color: var(--sub); margin: 14px 0; }

/* ── 菜单页 / APP 页 ── */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.menu-item { background: #fff; border-radius: 16px; padding: 18px 16px; box-shadow: var(--shadow);
  font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.menu-item .mi { font-size: 22px; }
.app-hero { text-align: center; padding: 30px 0 18px; }
.app-hero .app-icon { width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 24px;
  box-shadow: 0 12px 28px rgba(79,107,255,.26); }
.app-hero h1 { font-size: 23px; margin: 0 0 6px; }
.app-hero p { color: var(--muted); font-size: 13px; margin: 0; }
.step { display: flex; gap: 13px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; }
.step .n { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.step p { margin: 0; font-size: 13px; color: var(--sub); }

/* ── 提示 / 链接 ── */
.vip-msg { padding: 11px 14px; border-radius: 11px; font-size: 13px; margin: 12px 0; }
.vip-msg.err { background: #fdecee; color: #c92a37; }
.vip-msg.ok { background: #e9f8ef; color: #1a7f43; }
.vip-msg.info { background: var(--brand-soft); color: #3354c9; }
.link-row { background: #f8f9fc; border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; margin: 10px 0; word-break: break-all; font-size: 13px; }
.link-row a { color: var(--brand); }
.code { font-family: monospace; background: #fff; padding: 2px 6px; border: 1px dashed #cbd3e2;
  border-radius: 5px; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 14px; }

/* ── 自适应：手机一条窄栏 → 平板铺开 → 电脑全宽 ── */
/* 手机上保留底部五格导航；电脑上换成顶部横排导航，内容铺满可用宽度 */
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.top-nav { display: none; }

@media (min-width: 720px) {
  .vip-wrap { max-width: 900px; padding: 0 24px 32px; }
  .res-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .tabbar { left: 50%; transform: translateX(-50%); width: 900px;
    border-radius: 18px 18px 0 0; border: 1px solid var(--line); border-bottom: none; }
  .hero { padding: 30px 32px 26px; }
  .cat-grid, .menu-grid { grid-template-columns: repeat(3, 1fr); }
  .me-menu { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .vip-wrap { max-width: 1280px; padding: 0 32px 44px; }
  body.has-tabbar { padding-bottom: 0; }
  .topbar { padding: 12px 32px; }
  .topbar-inner { max-width: 1280px; margin: 0 auto; }
  .top-nav { display: flex; gap: 4px; margin-left: auto; margin-right: 18px; }
  .top-nav a { padding: 8px 14px; border-radius: 10px; font-size: 14px;
    font-weight: 600; color: var(--sub); }
  .top-nav a:hover, .top-nav a.on { background: var(--brand-soft); color: var(--brand); }
  .tabbar { display: none; }

  .res-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .res-body { padding: 14px 16px 16px; }
  .res-body h3 { font-size: 15px; }
  .res-price { font-size: 18px; }
  .hero { margin-top: 26px; padding: 40px 44px 34px; border-radius: 26px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 15px; margin-bottom: 22px; }
  .hero-search { max-width: 660px; padding: 7px 7px 7px 20px; }
  .hero-search input { font-size: 16px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 20px 0 10px; }
  .quick-card { padding: 24px 14px; }
  .cat-chips { gap: 10px; padding: 8px 0 14px; }
  .chip { padding: 9px 20px; font-size: 14px; }
  .section-label { font-size: 22px; margin: 30px 0 16px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
  .plan-grid { max-width: 900px; margin: 0 auto; }
  .faq-card { padding: 22px 26px; }
  .page-head { padding: 38px 0 24px; }
  .detail-hero { border-radius: 18px; }
}

@media (min-width: 1500px) {
  .vip-wrap, .topbar-inner { max-width: 1440px; }
  .res-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── 详情页：电脑上左封面右长图文，手机上上下堆叠 ── */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.detail-side, .detail-main { min-width: 0; }
@media (min-width: 1024px) {
  .detail-layout { grid-template-columns: 400px minmax(0, 1fr); gap: 26px; }
  .detail-side { position: sticky; top: 86px; }
}
.long-desc { padding: 22px 20px; }
@media (min-width: 1024px) { .long-desc { padding: 30px 36px 36px; } }
.ld-sec { margin: 0 0 30px; }
.ld-sec:last-child { margin-bottom: 0; }
.ld-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 18px; font-weight: 800; color: var(--ink); }
.ld-head::before { content: ''; width: 4px; height: 19px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand2)); }
.ld-head small { font-size: 12px; font-weight: 500; color: var(--muted); }
.ld-text { margin: 0 0 12px; font-size: 14px; line-height: 1.95; color: var(--sub); }
@media (min-width: 1024px) { .ld-text { font-size: 15px; line-height: 2; } }
.ld-bullets { list-style: none; margin: 0; padding: 0; }
.ld-bullets li { position: relative; padding: 7px 0 7px 24px; font-size: 14px;
  color: var(--sub); line-height: 1.8; border-bottom: 1px dashed var(--line); }
.ld-bullets li:last-child { border-bottom: none; }
.ld-bullets li::before { content: ''; position: absolute; left: 4px; top: 16px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.ld-outline { list-style: none; margin: 0; padding: 0; }
@media (min-width: 1024px) { .ld-outline { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; } }
.ld-outline li { display: flex; gap: 11px; align-items: baseline; padding: 9px 0;
  font-size: 14px; color: var(--sub); border-bottom: 1px solid var(--line); }
.ld-outline .n { flex: none; width: 24px; height: 24px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.ld-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ld-tags span { background: var(--brand-soft); color: var(--brand); border-radius: 999px;
  padding: 6px 14px; font-size: 12px; font-weight: 600; }
.ld-note { background: #f7f9fd; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 13px; color: var(--sub); line-height: 1.9; }
