/* ============================================================
   资源站（Web 端「资源页」）公开站点样式
   自包含 mini-site：封面 / 列表 / 详情，移动端优先
   ============================================================ */
:root {
  --rs-bg: #0f1115;
  --rs-card: #ffffff;
  --rs-accent: #ff5a5f;
  --rs-accent-2: #2f6bff;
  --rs-text: #1f2330;
  --rs-muted: #8a90a2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.rs-body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--rs-text);
  background: #f4f5f8;
  -webkit-font-smoothing: antialiased;
}
.rs-wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

/* 顶部条 */
.rs-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 720px; margin: 0 auto;
}
.rs-brand { font-weight: 700; font-size: 16px; color: var(--rs-text); text-decoration: none; }
.rs-topbar a.rs-back { color: var(--rs-muted); text-decoration: none; font-size: 14px; }

/* 封面 hero */
.rs-hero {
  background: linear-gradient(135deg, #1f2330 0%, #2f6bff 55%, #ff5a5f 100%);
  color: #fff; border-radius: 18px; padding: 40px 24px; text-align: center;
  box-shadow: 0 12px 40px rgba(47, 107, 255, .25);
}
.rs-hero h1 { font-size: 30px; margin: 0 0 14px; letter-spacing: 1px; }
.rs-hero p.rs-intro { font-size: 15px; line-height: 1.7; opacity: .92; margin: 0 auto 22px; max-width: 560px; }
.rs-btn {
  display: inline-block; border: none; border-radius: 999px; cursor: pointer;
  font-size: 16px; font-weight: 600; padding: 13px 34px; text-decoration: none;
  transition: transform .08s ease, box-shadow .2s ease;
}
.rs-btn:active { transform: scale(.97); }
.rs-btn-primary { background: #fff; color: var(--rs-accent-2); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.rs-btn-accent { background: var(--rs-accent); color: #fff; box-shadow: 0 8px 24px rgba(255,90,95,.4); }
.rs-btn-outline { background: transparent; color: var(--rs-accent-2); border: 1.5px solid var(--rs-accent-2); }
.rs-btn-block { display: block; width: 100%; text-align: center; }

/* 区块标题 */
.rs-section-title { font-size: 18px; font-weight: 700; margin: 26px 4px 12px; display: flex; align-items: center; gap: 8px; }
.rs-section-title::before { content: ""; width: 4px; height: 18px; background: var(--rs-accent); border-radius: 2px; }

/* 联系微信卡 */
.rs-wechat {
  background: var(--rs-card); border-radius: 14px; padding: 16px; margin-top: 18px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.06);
}
.rs-wechat img { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; border: 1px solid #eee; }
.rs-wechat .rs-wc-id { font-weight: 700; font-size: 16px; }
.rs-wechat .rs-wc-tip { color: var(--rs-muted); font-size: 13px; margin-top: 4px; }

/* 资源卡片 */
.rs-card {
  background: var(--rs-card); border-radius: 16px; overflow: hidden; margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
}
.rs-card .rs-cover {
  width: 100%; height: 200px; object-fit: cover; background: #eef0f4; display: block;
  cursor: pointer;
}
.rs-card .rs-carousel { position: relative; }
.rs-card .rs-carousel .rs-dot {
  position: absolute; bottom: 8px; left: 0; right: 0; text-align: center;
}
.rs-card .rs-carousel .rs-dot i {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 3px;
  background: rgba(255,255,255,.55);
}
.rs-card .rs-carousel .rs-dot i.on { background: #fff; }
.rs-card-body { padding: 14px 16px 16px; }
.rs-card-title { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.rs-actions { display: flex; gap: 10px; }
.rs-actions .rs-btn { flex: 1; font-size: 14px; padding: 11px 0; }

/* 详情 */
.rs-detail-title { font-size: 22px; font-weight: 800; margin: 6px 0 14px; }
.rs-detail-content { font-size: 15px; line-height: 1.8; color: #2a2f3d; word-break: break-word; }
.rs-detail-content img { max-width: 100%; border-radius: 10px; }
.rs-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.rs-gallery img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.rs-detail-actions { display: flex; gap: 10px; margin: 18px 0; }
.rs-detail-actions .rs-btn { flex: 1; font-size: 15px; padding: 13px 0; }

/* 空态 */
.rs-empty { text-align: center; color: var(--rs-muted); padding: 50px 0; }

/* 弹窗（密码门控） */
.rs-gate-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none;
  align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.rs-gate-mask.show { display: flex; }
.rs-gate {
  background: #fff; border-radius: 16px; width: 100%; max-width: 380px; padding: 22px; text-align: center;
  animation: rsPop .18s ease;
}
@keyframes rsPop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.rs-gate h3 { font-size: 18px; margin: 0 0 8px; }
.rs-gate .rs-gate-tip { color: var(--rs-muted); font-size: 14px; margin-bottom: 14px; line-height: 1.6; }
.rs-gate .rs-gate-wc { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 14px 0; }
.rs-gate .rs-gate-wc img { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; border: 1px solid #eee; }
.rs-gate input {
  width: 100%; border: 1.5px solid #e2e5ec; border-radius: 10px; padding: 12px 14px;
  font-size: 15px; margin: 6px 0 12px; outline: none;
}
.rs-gate input:focus { border-color: var(--rs-accent-2); }
.rs-gate .rs-gate-msg { font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.rs-gate .rs-gate-msg.err { color: #e23; }
.rs-gate .rs-gate-msg.ok { color: #1a9c54; }
.rs-gate-reveal { display: none; text-align: left; }
.rs-gate-reveal.show { display: block; }
.rs-gate-reveal textarea, .rs-gate-reveal .rs-url-box {
  width: 100%; border: 1.5px solid #e2e5ec; border-radius: 10px; padding: 10px 12px;
  font-size: 14px; background: #f8f9fc; margin: 6px 0 10px; resize: vertical; word-break: break-all;
}
.rs-gate-close { position: absolute; top: 10px; right: 14px; font-size: 22px; color: #aaa; cursor: pointer; }

/* 复制成功轻提示 */
.rs-toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; transition: opacity .2s ease; z-index: 1100; pointer-events: none;
}
.rs-toast.show { opacity: 1; }

/* ============ 三 Tab 选项卡 ============ */
.rs-tabs {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 0; max-width: 720px; margin: 0 auto;
  background: #fff; border-bottom: 1px solid #eef0f4;
}
.rs-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  padding: 13px 0; font-size: 15px; font-weight: 600; color: var(--rs-muted);
  position: relative; transition: color .15s ease;
}
.rs-tab.active { color: var(--rs-accent-2); }
.rs-tab.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 30px; height: 3px; border-radius: 2px; background: var(--rs-accent-2);
}
.rs-tab-pane { display: none; }
.rs-tab-pane.active { display: block; }
.rs-manage-tip { font-size: 12px; color: #8a90a2; margin: 4px 0 10px; line-height: 1.5; }
#rsManageFrame { background: #f4f5f8; border-radius: 12px; }

/* ============ 方案列表：聊天样式（复制 APP 首页） ============ */
.chat-item { margin-bottom: 20px; }
.chat-msg { display: flex; gap: 12px; }
.chat-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 19px; font-weight: 700;
}
.chat-body { flex: 1; min-width: 0; }
.chat-name { font-size: 13px; color: var(--rs-muted); margin-bottom: 6px; }
.chat-bubble {
  background: #fff; border-radius: 12px; padding: 12px; position: relative;
  display: inline-block; max-width: 100%; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
}
.group-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.group-title { font-size: 15px; font-weight: 600; color: #303133; }
.group-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 24px; padding: 0 8px; background: #2f6bff; color: #fff;
  font-size: 12px; font-weight: 600; border-radius: 12px; flex: 0 0 auto;
}
.group-thumbs { display: flex; gap: 6px; }
.group-thumb {
  width: 72px; height: 96px; border-radius: 6px; overflow: hidden;
  position: relative; background: #e4e7ed; flex: 0 0 auto; cursor: pointer;
}
.group-thumb:active { transform: scale(.97); }
.thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-more {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 22px; font-weight: 700;
}
.thumb-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px;
  font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============ 大模型 AI 区块（复制 APP /pages/ai/ai） ============ */
.ai-reason {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border-radius: 14px; padding: 16px; margin: 16px 0 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.06); cursor: pointer;
}
.ai-reason-ring {
  width: 54px; height: 54px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.ai-reason-ring.loading {
  background: conic-gradient(from 0deg, #2f6bff, rgba(47,107,255,.15) 70%, transparent 72%);
  animation: aiSpin 1.2s linear infinite;
}
.ai-reason-ring.ready { background: conic-gradient(#1a9c54 100%, #1a9c54 0); }
.ai-reason-ring::before {
  content: ""; position: absolute; inset: 5px; background: #fff; border-radius: 50%;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }
.ai-reason-emoji { position: relative; font-size: 22px; }
.ai-reason-body { flex: 1; min-width: 0; }
.ai-reason-title { font-size: 16px; font-weight: 700; color: #303133; }
.ai-reason-desc { font-size: 13px; color: var(--rs-muted); margin-top: 4px; line-height: 1.5; }
/* AI 推理进度条（每天 12:00 出一轮；到点未出新数据封顶 99%） */
.ai-reason-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ai-reason-bar-wrap {
  flex: 1; height: 6px; background: #eef0f4; border-radius: 999px; overflow: hidden;
}
.ai-reason-bar {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, #6aa8ff, #2f6bff);
  transition: width .4s ease;
}
.ai-reason-bar.ready { background: linear-gradient(90deg, #4ec96a, #1a9c54); }
.ai-reason-pct {
  flex: 0 0 auto; min-width: 40px; text-align: right;
  font-size: 12px; font-weight: 700; color: #2f6bff;
}
.ai-reason.ready .ai-reason-pct { color: #1a9c54; }

.ai-acts { display: flex; gap: 10px; margin-bottom: 14px; }
.ai-act {
  flex: 1; background: #fff; border-radius: 12px; padding: 12px 10px; text-align: center;
  font-size: 13px; color: #303133; cursor: pointer; position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,.05); display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ai-act.primary { background: linear-gradient(135deg, #ff7a18 0%, #ff3d6e 100%); color: #fff; font-weight: 700; }
.ai-act-ico { font-size: 16px; }
.ai-act-badge {
  position: absolute; top: -6px; right: -4px; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; color: #fff;
}
.ai-act-badge.new { background: #fa5151; }
.ai-act-badge.ing { background: #f0a020; }

/* 今日 AI 推理预测：主行动按钮（优化显示） */
.ai-primary-act {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; padding: 14px 16px;
  border-radius: 14px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #ff7a18 0%, #ff3d6e 100%);
  box-shadow: 0 8px 24px rgba(255,61,110,.28);
}
.ai-primary-act.loading {
  background: linear-gradient(135deg, #6b7bff 0%, #2f6bff 100%);
  box-shadow: 0 8px 24px rgba(47,107,255,.28);
}
.ai-primary-act:active { transform: scale(.98); }
.ai-primary-act .ai-act-ico { font-size: 22px; flex: 0 0 auto; }
.ai-primary-act .ai-act-main { flex: 1; min-width: 0; line-height: 1.35; }
.ai-primary-act .ai-act-t { font-size: 16px; font-weight: 800; display: block; }
.ai-primary-act .ai-act-sub { font-size: 12px; opacity: .92; display: block; margin-top: 2px; }
.ai-primary-act .ai-act-badge {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.28);
}
.ai-primary-act.ready .ai-act-badge { background: #fff; color: #ff3d6e; }
.ai-primary-act.loading .ai-act-badge { background: #fff; color: #2f6bff; }

.ai-sec { margin-bottom: 14px; }
.ai-sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 4px 8px;
}
.ai-sec-title { font-size: 15px; font-weight: 700; color: #303133; }
.ai-card {
  background: #fff; border-radius: 14px; padding: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
}
.ai-shots { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.ai-shot {
  width: 120px; height: 160px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: #eef0f4;
  cursor: pointer;
}
.ai-shot:active { opacity: .85; }
.ai-card.hist { padding: 6px 12px; }
.ai-h-item { padding: 12px 0; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.ai-h-item:last-child { border-bottom: none; }
.ai-h-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-h-q .q { font-size: 14px; color: #303133; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-h-q .st { font-size: 12px; color: var(--rs-muted); flex: 0 0 auto; }
.ai-loadmore { text-align: center; padding: 14px; font-size: 13px; }
.ai-loadmore.more { color: #2f6bff; cursor: pointer; }
.ai-loadmore.dim { color: #b6bcc8; }
.ai-foot {
  text-align: center; color: #aab; font-size: 12px; line-height: 1.8; padding: 10px 0 30px;
}

/* ============ 通用弹窗（方案群二维码 / 等） ============ */
.rs-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none;
  align-items: center; justify-content: center; z-index: 1200; padding: 16px;
}
.rs-modal-mask.show { display: flex; }
.rs-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 340px; overflow: hidden;
  animation: rsPop .18s ease;
}
.rs-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #f0f2f5;
}
.rs-modal-title { font-size: 16px; font-weight: 700; color: #303133; }
.rs-modal-close { font-size: 24px; color: #aaa; cursor: pointer; line-height: 1; }
.rs-modal-body { padding: 20px 16px; text-align: center; }
.rs-wx-qr { width: 220px; height: 220px; border-radius: 10px; object-fit: cover; border: 1px solid #eee; }
.rs-wx-fallback { padding: 20px 0; color: var(--rs-muted); font-size: 14px; }
.rs-wx-tip { margin-top: 14px; font-size: 15px; font-weight: 700; color: #fa5151; }

/* ============ 详情页：教程区（视频 + 教程图） ============ */
.rs-tutorial {
  margin: 16px 0; padding: 14px; background: #fff; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(20,30,60,.06);
}
.rs-tutorial-title { font-size: 16px; font-weight: 700; color: #303133; margin-bottom: 12px; }
.rs-tut-video { margin-bottom: 12px; }
.rs-tut-video video,
.rs-tut-video iframe {
  width: 100%; aspect-ratio: 16 / 9; height: auto; display: block;
  border-radius: 10px; background: #000; border: none;
}
.rs-tut-video-fallback { margin-top: 8px; font-size: 13px; color: var(--rs-muted); text-align: center; }
.rs-tut-video-fallback a { color: #2f6bff; }
.rs-tut-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rs-tut-gallery img {
  width: 100%; height: 110px; object-fit: cover; border-radius: 10px;
  cursor: zoom-in; background: #f5f6f8;
}

/* ============ 图片灯箱（预览图 / 教程图点击放大） ============ */
.rs-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.rs-lightbox.show { display: flex; }
.rs-lb-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 6px; animation: rsPop .18s ease;
  -webkit-user-select: none; user-select: none;
}
.rs-lb-close {
  position: absolute; top: 14px; right: 16px; font-size: 34px; line-height: 1;
  color: #fff; opacity: .85; cursor: pointer; padding: 6px 10px; z-index: 2;
}
.rs-lb-close:hover { opacity: 1; }
.rs-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.14); color: #fff; border: none;
  font-size: 30px; line-height: 1; width: 44px; height: 64px;
  border-radius: 8px; cursor: pointer; z-index: 2;
}
.rs-lb-nav.prev { left: 12px; }
.rs-lb-nav.next { right: 12px; }
.rs-lb-nav:hover { background: rgba(255,255,255,.28); }
.rs-lb-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.8); font-size: 13px; z-index: 2;
}
@media (max-width: 480px) {
  .rs-lb-nav { width: 36px; height: 52px; font-size: 24px; }
}

