/* ============ 咨询有道 · 用户端 H5 ============ */
:root {
  --primary: #4f46e5;
  --violet: #7c3aed;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #7b8498;
  --line: #eceef5;
  --bg: #f4f5fa;
  --card: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e9ebf3;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; cursor: pointer; }

/* 手机画布：桌面浏览时居中展示 */
.app {
  position: relative;
  width: 100%; max-width: 560px; min-height: 100vh;
  margin: 0 auto; background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 60px -20px rgba(15, 23, 42, .25);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(env(safe-area-inset-top) + 22px) 18px 58px;
  background: linear-gradient(150deg, #4338ca 0%, #4f46e5 42%, #7c3aed 100%);
  color: #fff;
  border-radius: 0 0 26px 26px;
}
.hero-deco {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 0 0 26px 26px;
}
.hero-deco::before {
  content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%;
  right: -90px; top: -80px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%);
}
.hero-deco::after {
  content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%;
  left: -70px; bottom: -60px;
  background: radial-gradient(circle, rgba(165,243,252,.28), transparent 70%);
}
.hero-content { position: relative; z-index: 1; }

.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: rgba(255, 255, 255, .16);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
.brand-meta { flex: 1; min-width: 0; }
.brand-meta h1 { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.brand-meta p { font-size: 12px; color: rgba(255,255,255,.78); margin-top: 1px; }
.live-tag {
  flex-shrink: 0; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28);
  padding: 4px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.live-tag i { width: 6px; height: 6px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 3px rgba(110,231,183,.25); }

.hero-slogan { margin: 24px 0 18px; font-size: 24px; font-weight: 800; line-height: 1.4; letter-spacing: .3px; }
.hero-slogan span {
  font-size: 15px; font-weight: 600; color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.14); padding: 3px 12px; border-radius: 999px;
}

.search-bar {
  display: flex; align-items: center; gap: 9px;
  height: 48px; padding: 0 16px; border-radius: 999px;
  background: #fff; color: #94a3b8;
  box-shadow: 0 12px 28px -14px rgba(15, 23, 42, .5);
}
.search-bar input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.search-bar input::placeholder { color: #9aa5b8; }

.quick-stats {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  font-size: 12.5px; color: rgba(255,255,255,.88);
}
.quick-stats b { font-size: 15px; font-weight: 800; color: #fff; }
.quick-stats .sep { width: 1px; height: 12px; background: rgba(255,255,255,.3); }

/* ---------- 分类 Chips ---------- */
.chips-wrap {
  margin: -34px 0 0; position: relative; z-index: 2;
  padding: 0 14px;
}
.chips {
  display: flex; gap: 9px; overflow-x: auto; flex-wrap: nowrap;
  padding: 10px; background: #fff; border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px -16px rgba(15, 23, 42, .25);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 17px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); background: #f1f3f9; transition: all .2s;
}
.chip.active {
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 7px 15px -8px rgba(99,102,241,.85);
}

/* ---------- 内容列表 ---------- */
.content { padding: 22px 14px 8px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 4px 14px; }
.list-head h2 { font-size: 17px; font-weight: 800; }
.list-head span { font-size: 12.5px; color: var(--muted); }

.module-list { display: flex; flex-direction: column; gap: 12px; }

.module-card {
  position: relative;
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 15px; text-align: left; width: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.module-card:active { transform: scale(.985); background: #fafbff; }

.module-logo {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  font-size: 21px; font-weight: 800; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 6px 14px -8px rgba(15,23,42,.4);
}
.module-logo img { width: 100%; height: 100%; object-fit: cover; }
.lc-0 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.lc-1 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.lc-2 { background: linear-gradient(135deg, #10b981, #059669); }
.lc-3 { background: linear-gradient(135deg, #f59e0b, #f97316); }
.lc-4 { background: linear-gradient(135deg, #ec4899, #db2777); }
.lc-5 { background: linear-gradient(135deg, #14b8a6, #0891b2); }
.lc-6 { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
.lc-7 { background: linear-gradient(135deg, #ef4444, #f97316); }

.card-body { flex: 1; min-width: 0; }
.card-line1 { display: flex; align-items: center; gap: 8px; }
.card-name { font-size: 16px; font-weight: 700; }
.card-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--primary);
  background: #eef2ff; padding: 1px 8px; border-radius: 6px;
}
.card-desc {
  margin-top: 4px; font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-arrow {
  flex-shrink: 0; color: #c2c8d8;
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: #f4f5fa; transition: all .2s;
}
.module-card:active .card-arrow { color: var(--primary); background: #eef2ff; }

/* 骨架屏（与真实卡片同尺寸，避免布局跳动 CLS） */
.skeleton-row {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 15px;
}
.skeleton-row .sk-logo {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
}
.sk-body { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.sk-line { height: 11px; border-radius: 6px; display: block; }
.sk-line.w55 { width: 55%; height: 13px; }
.sk-line.w80 { width: 80%; }
.skeleton-row .sk-logo, .skeleton-row .sk-line {
  background: linear-gradient(90deg, #eef0f7 25%, #f7f8fc 37%, #eef0f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.load-more-wrap { display: flex; justify-content: center; padding: 16px 0 4px; }
.btn-loadmore {
  background: #f1f3f9; color: var(--ink-2); font-size: 14px; font-weight: 600;
  padding: 10px 34px; border-radius: 999px;
}
.btn-loadmore:active { background: #e6e9f5; }

/* 最近访问 */
.recent-wrap { padding: 16px 14px 0; }
.recent-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 10px; }
.recent-head h2 { font-size: 15px; font-weight: 800; }
.recent-head button { font-size: 12px; color: var(--muted); }
.recent-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 4px 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.recent-scroll::-webkit-scrollbar { display: none; }
.recent-item {
  flex: 0 0 auto; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.recent-item .module-logo { width: 46px; height: 46px; border-radius: 13px; font-size: 18px; }
.recent-name {
  font-size: 12px; color: var(--ink-2); text-align: center; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 回到顶部 */
.back-top {
  position: fixed; right: 16px; bottom: calc(22px + env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.96); border: 1px solid var(--line);
  color: var(--primary); box-shadow: 0 8px 22px -8px rgba(15,23,42,.35);
  display: grid; place-items: center; z-index: 50;
}
.back-top:active { transform: scale(.94); }

/* 加载 / 空态 */
.loading, .empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.spinner {
  display: inline-block; width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid #e3e6fb; border-top-color: var(--primary); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { margin-top: 12px; font-size: 13.5px; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: 16px; }
.empty svg { margin-bottom: 12px; }
.empty h3 { font-size: 16px; color: var(--ink-2); }
.empty p { font-size: 13.5px; margin: 5px 0 16px; }
.btn-reset {
  background: #eef2ff; color: var(--primary); font-size: 13.5px; font-weight: 600;
  padding: 9px 22px; border-radius: 999px;
}

/* ---------- 优势区 ---------- */
.perks { margin-top: 28px; }
.block-title { font-size: 16px; font-weight: 800; padding: 0 4px 14px; }
.perk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.perk {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 6px 12px; text-align: center;
}
.perk-ico {
  width: 38px; height: 38px; border-radius: 11px; margin: 0 auto 8px;
  display: grid; place-items: center;
}
.p1 { background: #eef2ff; color: #4f46e5; }
.p2 { background: #fef3c7; color: #d97706; }
.p3 { background: #cffafe; color: #0891b2; }
.p4 { background: #fce7f3; color: #db2777; }
.perk b { display: block; font-size: 12.5px; font-weight: 700; }
.perk small { font-size: 11px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  text-align: center; padding: 26px 16px calc(env(safe-area-inset-bottom) + 24px);
  color: #9aa1b5; font-size: 12.5px;
}
.footer-links { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; }
.footer-links a { font-size: 13px; font-weight: 600; color: var(--primary); }
.footer-links span { width: 1px; height: 12px; background: #d6dae8; }
