/* ============================================================
   XQ-Blackgold 设计系统 · B 方案独立站
   依据: 新圈 com.zjxj.yiyou 2.1.2 真机截图逐像素采样 + 反编译 tokens.json
   采样报告: docs/xinquan-1to1-feasibility.md · 采样器: scripts/xq-sample.py
   与主站 SPA 完全解耦，零共享文件（gate 除外）
   ============================================================ */

/* ═══ 两层 token 结构 ═══
   层1 tokens.css: Android res 真值（--xq-c-* / --xq-g-*，保留资源名，Flutter 溯源）
   层2 本文件: 语义变量（--xq-*），全部引用层1，跨端映射见 docs/xq-token-map.md */
:root {
  /* 表面 */
  --xq-page: #111111;          /* 页面底（聊天/设置页实测精确命中；res 无对应，截图定值） */
  --xq-card: var(--xq-c-color_1E1E1F);          /* 卡片 = res color_1E1E1F */
  --xq-card-alt: var(--xq-c-color_1B1B28);
  --xq-elev: var(--xq-c-color_user_line);       /* 输入栏/弹层 = res color_user_line(#222) */
  --xq-line: var(--xq-c-color_user_line);       /* 分割线（隐形级） */

  /* 金 */
  --xq-gold: var(--xq-c-btn_select_yellow_text); /* 主金 = res btn_select_yellow_text(#F2C467) */
  --xq-gold-light: #FFDD98;
  --xq-gold-deep: #4E0505;     /* 金底上的深字（token gold-button-text） */
  --xq-gold-grad: var(--xq-g-bg_button_default_yellow_gradient_bg);  /* res bg_button_default_yellow_gradient_bg(angle0+centerColor→css90deg) */
  --xq-glow: #5E3303;          /* 顶饰峰值·深琥珀（实测，非亮金） */
  --xq-gold-dim: rgba(242, 196, 103, 0.10);
  --xq-gold-line: rgba(242, 196, 103, 0.45);

  /* 文字 */
  --xq-t1: #ECECEC;  --xq-t2: #CECECE;  --xq-t3: #A8A4A3;

  /* 语义彩（仅功能，分类图标一律金） */
  --xq-red: #E52222;  --xq-online: #00E69D;  --xq-auth: #00CB64;
  --xq-blue: #2196F3; --xq-orange: #FF9500;  --xq-pink: #FF6B9D;
  --xq-alipay: #1677FF; --xq-wechat: #22C55E;

  /* 尺寸标尺（flutter-diff 反编译 layout） */
  --xq-appbar: 45px; --xq-tabbar: 65px; --xq-cta: 48px;
  --xq-r8: 8px; --xq-r12: 12px; --xq-r16: 16px; --xq-r20: 20px; --xq-pill: 999px;

  --xq-shadow-card: 0 2px 12px rgba(0,0,0,0.4);
  --xq-shadow-gold: 0 4px 16px rgba(242,196,103,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--xq-page); color: var(--xq-t1);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}

/* ============ 设备画布 ============ */
.xq-app {
  width: 375px; height: 812px; margin: 0 auto; background: var(--xq-page);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}

/* ============ XqPageBg 顶饰（原厂资产 page_top_bg.png，view_top_bg 200dp，
      实测仅首页/我的使用；消息/社区/设置页无顶饰） ============ */
.xq-glow { position: absolute; top: 0; left: 0; right: 0; height: 15%; pointer-events: none; z-index: 0; }
.xq-glow--full { background: url('img/orig/page_top_bg.png') center top / 100% 100% no-repeat; height: 172px; }
/* 设置等：无顶饰（不加类） */

/* H01 首页 banner：后端运营图 3 张轮播 crossfade（2026-08-25 模拟器录屏实证 ~2.9s/张、
   过渡 ~0.35s；首页唯一动画元素——feed 徽章 PAG 在模拟器 feed 里为暂停帧） */
.xq-banner-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: xqBannerCycle 8.7s infinite; }
@keyframes xqBannerCycle {
  0% { opacity: 0; } 4% { opacity: 1; } 29% { opacity: 1; } 33% { opacity: 0; } 100% { opacity: 0; }
}
/* 截图/对齐模式（uiAudit=1）：动画冻结首帧，像素对比不受轮播相位影响 */
.ui-audit .xq-banner-slide { animation: none; }
.ui-audit .xq-banner-slide:first-of-type { opacity: 1; }

.xq-body { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; z-index: 1; }
.xq-body::-webkit-scrollbar { display: none; }

/* ============ XqAppBar 45px ============ */
.xq-appbar {
  height: var(--xq-appbar); display: flex; align-items: center; padding: 0 12px;
  gap: 8px; flex-shrink: 0; position: relative; z-index: 2;
}
.xq-appbar .back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--xq-t1); cursor: pointer; }
.xq-appbar .title { font-size: 18px; font-weight: 600; flex: 1; text-align: center; }
.xq-appbar .title.left { text-align: left; }
.xq-appbar .act { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--xq-t2); cursor: pointer; }

/* ============ MagicTabs（选中金文字+下划线，实测无胶囊） ============ */
.xq-tabs { display: flex; align-items: center; gap: 7.7px; height: 44px; }
.xq-tab {
  display: flex; align-items: center; justify-content: center; width: 50px; height: 44px;
  font-size: 16px; color: var(--xq-t3); cursor: pointer;
  transition: all .18s; white-space: nowrap; position: relative;
}
.xq-tab.on { color: var(--xq-gold); font-weight: 700; }
.xq-tab.on::after { content: ""; position: absolute; left: 34%; right: 34%; bottom: 4px; height: 3px; border-radius: 2px; background: var(--xq-gold); }
.xq-tab .bdg99 { position: absolute; top: 3.1px; right: -4px; }

/* ============ 金按钮 XqGoldButton（CTA1 标准） ============ */
.xq-btn {
  height: var(--xq-cta); border: none; border-radius: var(--xq-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 16px; font-weight: 700; cursor: pointer; width: 100%;
  background: var(--xq-gold-grad); color: var(--xq-gold-deep);
  box-shadow: var(--xq-shadow-gold); transition: transform .12s;
}
.xq-btn:active { transform: scale(0.98); }
.xq-btn.sm { height: 32px; font-size: 13px; width: auto; padding: 0 18px; }
/* 金描边按钮（微信卡"复制" shape_primary_yellow） */
.xq-btn-o {
  border: 1px solid var(--xq-gold-line); color: var(--xq-gold); background: var(--xq-gold-dim);
  border-radius: var(--xq-pill); height: 28px; padding: 0 16px; font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 600;
}

/* ============ 卡片/列表 ============ */
.xq-card { background: var(--xq-card); border-radius: var(--xq-r12); box-shadow: var(--xq-shadow-card); }
.xq-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  background: var(--xq-card); border-bottom: 1px solid var(--xq-line); cursor: pointer;
}
.xq-cell { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--xq-line); }

/* 功能入口图标：一律金色（实测新圈消息页/我的页） */
.xq-ico {
  width: 46px; height: 46px; border-radius: var(--xq-r12); flex-shrink: 0;
  background: var(--xq-gold-dim); color: var(--xq-gold);
  display: flex; align-items: center; justify-content: center;
}

/* ============ 徽标/角标 ============ */
.xq-badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--xq-pill);
  background: var(--xq-red); color: #fff; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.xq-vipbadge { font-size: 10px; color: var(--xq-gold-deep); background: var(--xq-gold); border-radius: 4px; padding: 1px 5px; font-weight: 700; }
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 6px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.tag-auth { background: rgba(0,203,100,0.14); color: var(--xq-auth); }
.tag-blue { background: rgba(33,150,243,0.14); color: var(--xq-blue); }
.tag-pink { background: rgba(255,107,157,0.14); color: var(--xq-pink); }
.tag-gold { background: var(--xq-gold-dim); color: var(--xq-gold); }

/* ============ 底部 TabBar 65px #1E1E1F（实测非纯黑） ============ */
.xq-tabbar {
  height: var(--xq-tabbar); background: var(--xq-card); border-top: 1px solid var(--xq-line);
  display: flex; flex-shrink: 0; position: relative; z-index: 3;
}
.xq-tabbar .it {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--xq-t3); font-size: 10px; cursor: pointer; position: relative;
}
.xq-tabbar .it.on { color: var(--xq-gold); font-weight: 600; }
.xq-tabbar .it .bdg { position: absolute; top: 3.2px; left: calc(50% + 1px); }

/* ============ 聊天 ============ */
.xq-bubble-row { display: flex; gap: 8px; padding: 6px 12px; align-items: flex-start; }
.xq-bubble-row.me { flex-direction: row-reverse; }
.xq-bubble { max-width: 66%; padding: 9px 12px; border-radius: var(--xq-r12); font-size: 14px; line-height: 1.45; word-break: break-word; }
.xq-bubble-row:not(.me) .xq-bubble { background: var(--xq-elev); color: var(--xq-t1); border-top-left-radius: 4px; }
.xq-bubble-row.me .xq-bubble { background: var(--xq-gold); color: var(--xq-gold-deep); border-top-right-radius: 4px; }
.xq-bubble .pic { width: 140px; height: 180px; border-radius: 8px; object-fit: cover; display: block; }

/* ============ VIP 卡（金渐变，实测 FCD971→F2C467→D6AF60） ============ */
.xq-vipcard {
  background: var(--xq-gold-grad); border-radius: var(--xq-r16); color: var(--xq-gold-deep);
  padding: 16px; position: relative; overflow: hidden;
}
.xq-vipcard .shine {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.28) 46%, transparent 62%);
}

/* ============ 底部弹层 ============ */
.xq-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.55); z-index: 40; display: none; }
.xq-mask.on { display: block; }
.xq-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--xq-card);
  border-radius: var(--xq-r20) var(--xq-r20) 0 0; padding: 18px 16px 26px; z-index: 41;
  display: none;
}
.xq-sheet.on { display: block; }
.xq-sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: #3a3a3b; margin: 0 auto 14px; }

/* ============ 表单 ============ */
.xq-input {
  height: 44px; background: var(--xq-elev); border: none; border-radius: var(--xq-r12);
  padding: 0 14px; color: var(--xq-t1); font-size: 14px; width: 100%; outline: none;
}
.xq-input::placeholder { color: var(--xq-t3); }

/* ============ 杂项 ============ */
.xq-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--xq-online); display: inline-block; }
.xq-divider { height: 1px; background: var(--xq-line); }
.xq-toast {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,0.78); color: #ECECEC; padding: 10px 18px; border-radius: var(--xq-r12);
  font-size: 13px; z-index: 99; pointer-events: none; max-width: 75%; text-align: center;
}
.fade-in { animation: fin .25s ease; }
@keyframes fin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
#fltAgeMin::-webkit-slider-thumb,#fltAgeMax::-webkit-slider-thumb{-webkit-appearance:none;width:22px;height:22px;border-radius:50%;background:#fff;border:2px solid #F4BA47;box-shadow:0 1px 4px rgba(0,0,0,.25);cursor:pointer;pointer-events:auto}
#fltAgeMax{clipPath:none!important}


/* ============ 动效层 v40 (交互对齐: 转场/下拉刷新/上拉加载/图片查看器) ============ */
@keyframes xqInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes xqInLeft  { from { transform: translateX(-28%); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
@keyframes xqFade    { from { opacity: .35; } to { opacity: 1; } }
.xq-trans { width: 100%; height: 100%; display: flex; flex-direction: column; }
.xq-slide-r { animation: xqInRight .26s cubic-bezier(.25,.8,.35,1); }
.xq-slide-l { animation: xqInLeft .24s cubic-bezier(.25,.8,.35,1); }
.xq-fade    { animation: xqFade .18s ease-out; }

/* SmartRefreshLayout 经典样式 (原厂默认 header) */
.xq-ptr { position: absolute; top: 0; left: 0; right: 0; height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: #CACACA; background: var(--xq-page); z-index: 9;
  transition: height .18s ease; }
.xq-ptr.on { transition: none; }
.xq-ptr .arr { display: inline-block; transition: transform .2s; font-size: 15px; color: #8a8a8b; }
.xq-ptr.spin .arr { display: none; }
.xq-ptr .ldr { display: none; width: 16px; height: 16px; border: 2px solid #3a3a3b; border-top-color: #F2C467;
  border-radius: 50%; animation: xqSpin .7s linear infinite; }
.xq-ptr.spin .ldr { display: inline-block; }
@keyframes xqSpin { to { transform: rotate(360deg); } }

/* 上拉加载 footer */
.xq-more { text-align: center; padding: 14px 0 18px; font-size: 12px; color: #666; }
.xq-more .dot { display: inline-block; width: 14px; height: 14px; border: 2px solid #3a3a3b;
  border-top-color: #F2C467; border-radius: 50%; animation: xqSpin .7s linear infinite;
  vertical-align: -3px; margin-right: 6px; }

/* 图片查看器 */
.xq-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.96); z-index: 999;
  display: flex; align-items: center; justify-content: center; }
.xq-viewer img { max-width: 100%; max-height: 86%; transition: transform .06s linear; will-change: transform; }
.xq-viewer .cls { position: absolute; top: 14px; right: 16px; color: #fff; font-size: 26px; padding: 6px 10px; cursor: pointer; }
.xq-viewer .tip { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; color: #8a8a8b; font-size: 11px; }

/* VIP 徽章动画示意：真实 App 为后端下发 PAG 矢量动画（TagListPagView+libpag，
   icon URL 以 .pag 结尾时播放；本模拟器实例后端返回静态帧故录屏无变化）。
   设计稿以亮度脉冲表达"该徽章为动画"；uiAudit 截图模式冻结。 */
.xq-vip-badge { animation: xqVipPulse 2.4s ease-in-out infinite; }
@keyframes xqVipPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.38); } }
.ui-audit .xq-vip-badge { animation: none; }
