/* ============================================================
   Mahjong Pal · Showtime / 圈子热帖页样式（八哥令 2026-10-23）
   黑金风格；卡片形式照首页热帖区：头像 + 名字 + 📍地点 · 时间 + 正文一行。
   小猴子图标缩小（30px，八哥令「图标要小一点」）；窄条一行一条，可滑。
   ============================================================ */

#circle-view {
  /* 八哥令 2026-10-23（线上实测塌陷修复）：必须与 main-view/data-view 同级
     参与 body flex 挤压——只写 flex-direction 不写 flex:1 会让本视图高度归 0，
     里头的东西（详情层/iframe）全部塌成一条线，底栏都被顶到屏幕顶上去。
     历史故障：八哥截图「详情页只占内容高度、下方大片空黑」的真凶就是这里，
     之前只修了 .cd-scroll/.cd-frame，没修到根上。 */
  display: none;                /* pal.js toggles to flex */
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--pal-bg, #000);
}

/* ---------- 顶区：小猴子（缩小版）+ 那句话（金渐变衬线，居中）---------- */
.ci-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--pal-hair);
}
/* 八哥令 2026-11-12：右侧两枚圆钮（发帖小花 + 4 标识）同组排布，
   文字让出宽度、下移一点、两行按字数均衡折行，不再被按钮压住 */
.ci-acts { display: flex; align-items: center; gap: 8px; flex: none; margin-right: 8px; }
.ci-acts .ci-compose { margin-right: 0; }
/* 旧小花：四环 + 中心点，与顶部标识同一金色、同一线重语言 */
.ci-flower { position: relative; display: block; width: 22px; height: 22px; color: var(--pal-gold-l); }
.ci-flower i { position: absolute; width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.ci-flower i:nth-child(1) { left: 0; top: 0; }
.ci-flower i:nth-child(2) { right: 0; top: 0; }
.ci-flower i:nth-child(3) { left: 0; bottom: 0; }
.ci-flower i:nth-child(4) { right: 0; bottom: 0; }
.ci-flower b { position: absolute; left: 9px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
/* 4 标识（无花版）：与顶部同一套坐标，只把断开的左撇连成一笔；
   在 42px 圆钮里整体放大 1.18 倍，问号才读得清（几何比例原样不变） */
.pal-mark.ci-4mark .pm-diag { width: 19.4px; transform: rotate(-60.6deg); }
.pal-mark.ci-4mark { transform: scale(1.18); transform-origin: 50% 50%; }
/* 八哥令：图标要小一点——首页同款笑脸猴 48 viewBox 缩到 30px */
.ci-monkey {
  width: 30px;
  height: 30px;
  flex: none;
  color: #10B981;
  filter: drop-shadow(0 1px 4px rgba(16, 185, 129, .28));
}
.ci-line {
  margin: 0;
  padding-top: 4px;          /* 让出按钮高度后整句略往下坐 */
  flex: 1 1 auto;
  min-width: 0;              /* 允许被压缩，绝不钻到按钮底下 */
  text-wrap: balance;        /* 两行按字数均衡折行，上下等长 */
  font-family: var(--pal-serif);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  background: linear-gradient(100deg, var(--pal-gold-l) 0%, var(--pal-gold) 55%, var(--pal-gold-d) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 列表：窄条一行一条，可滑 ---------- */
.ci-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px 14px 24px;
}
.ci-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;      /* 八哥令：窄一点 */
}
.ci-row {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--pal-line);
  background: var(--pal-panel);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .12s ease;
}
.ci-row:active { transform: scale(.985); background: var(--pal-panel-2); }

/* 八哥令 2026-11-12：头像独立动作区外圈——绿勾挂在圈外，不被 .ci-av 的
   overflow:hidden 裁掉；只有带 user_id 的注册用户才显示可点绿勾。 */
.ci-avw {
  position: relative;
  flex: none;
  display: inline-flex;
  border-radius: 50%;
}
.ci-avw[data-uid] { cursor: pointer; }
.ci-avw .real-check {
  width: 12px;
  height: 12px;
  top: -2px;
  right: -2px;
}
.ci-avw .real-check svg {
  width: 8px;
  height: 8px;
}
.ci-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
/* 头像：首页同款粉渐变圆 + 首字母兜底（img 加载失败自隐露字母） */
.ci-av {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F3B8C9 0%, #E08BA8 100%);
}
.ci-av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ci-av-fb {
  font-style: normal;
  font-family: var(--pal-serif);
  font-size: 13px;
  font-weight: 700;
  color: #5A2233;
}
.ci-name {
  flex: none;
  max-width: 34%;
  font-family: var(--pal-serif);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pal-txt, #F6EFE0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 11px;
  color: var(--pal-mut);
  white-space: nowrap;
  overflow: hidden;
}
/* 红色坐标（与首页同款小红针） */
.ci-pin { flex: none; display: inline-flex; width: 11px; height: 11px; color: #E2554B; }
.ci-pin svg { width: 11px; height: 11px; }
.ci-place { overflow: hidden; text-overflow: ellipsis; }
.ci-dot { flex: none; opacity: .6; }
.ci-time { flex: none; color: var(--pal-mut); opacity: .85; }

/* 正文：只显示一行（八哥令「只显示一行」） */
.ci-txt {
  margin: 7px 0 0;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(246, 239, 224, .88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 空态 */
.ci-empty {
  margin: 44px auto 0;
  max-width: 300px;
  text-align: center;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.7;
  color: var(--pal-mut);
}
.ci-empty[hidden] { display: none; }

/* ============================================================
   详情层（八哥令二令 2026-10-23）：黑金渲染整条串，原位切换，
   头（.pal-top）脚（#palTabbar）纹丝不动，绝不跳出 PWA。
   ============================================================ */
/* 详情层外壳：定位基准 + 硬裁剪。iframe 改绝对定位后由它当锚点。 */
.cd-pane {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;   /* .cd-frame 绝对钉底的基准 */
  overflow: hidden;     /* 任何越界一律裁在详情层内 */
}
.cd-pane[hidden] { display: none; }
/* 顶条：Around the Table 黑金标题 + 白叉（无 Back）。高度写死 46px，
   与 .cd-scroll 的 top:46px 成对——改一处必须同时改另一处。 */
.cd-top {
  flex: none;
  height: 46px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--pal-hair);
}
/* 八哥令：不许有 Back——标题后一颗【白色】大叉关回列表（点区放大好按；
   ❌ emoji 无法变色，用白色 SVG，大小不变） */
.cd-x {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 6px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cd-x svg { width: 22px; height: 22px; display: block; }
.cd-x:active { transform: scale(.86); }
.cd-title {
  font-family: var(--pal-serif);
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(100deg, var(--pal-gold-l) 0%, var(--pal-gold) 55%, var(--pal-gold-d) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* 内嵌容器：从 .cd-top 底缘一路钉到 .cd-pane 底部。
   绝对定位而非 flex——iframe 作为 flex item 在移动端不保证拉伸到容器高度
   （历史故障：iframe 只有内容那么高，下方一大片空黑；内容顶部还被黑条切掉）。
   绝对钉死后 iframe 高度 = 标题条底缘到详情层底缘，与主站页面无关，恒等于几何。 */
.cd-scroll {
  position: absolute;
  left: 0;
  right: 0;
  top: 46px;      /* .cd-top 高度：10px+10px 上下 padding + 22px 叉 */
  bottom: 0;
  display: block;
  overflow: hidden;
  background: var(--pal-ink);   /* 内嵌页加载瞬间的空窗也是墨黑，不闪白 */
}
/* 主站 /post?id=&embed=1 原封内嵌：占满内嵌容器，
   白底即主站本色（embed 模式内页面自身背景已归黑）。 */
.cd-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--pal-ink);
}
/* 帖子卡 */
.cd-post {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--pal-line);
  background: var(--pal-panel);
  margin: 0 auto;
  max-width: 460px;
}
.cd-reply-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.cd-av {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F3B8C9 0%, #E08BA8 100%);
}
/* 【八哥实测头像裂图修复】详情层头像 img 必须与列表同规则——绝对定位盖满圆、
   露出时字母兜底藏在下面。此前只写了 .ci-av img，详情层 .cd-av img 缺规则
   → img 与字母并排（半个图半个 M）。 */
.ci-av img, .cd-av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.cd-av-sm { width: 28px; height: 28px; }
.cd-av-sm .ci-av-fb { font-size: 11.5px; }
.cd-rname {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--pal-serif);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--pal-txt, #F6EFE0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 赞数小徽（金边胶囊 + 👍） */
.cd-like {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, .4);
  background: rgba(212, 175, 55, .1);
  color: var(--pal-gold-l);
}
.cd-like svg { width: 12px; height: 12px; }
.cd-like b { font-family: Georgia, serif; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cd-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 11px;
  color: var(--pal-mut);
}
.cd-text {
  margin: 9px 0 0;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(246, 239, 224, .92);
  white-space: pre-wrap;
  word-break: break-word;
}
/* 帖图：圆角 + 等比缩放（详情页数据照调，图照显） */
.cd-photo {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 10px auto 0;
  border-radius: 12px;
  border: 1px solid var(--pal-hair);
}
/* 回帖串：嵌套最多 3 层，逐层缩进金线 */
.cd-replies {
  margin: 10px auto 0;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cd-reply {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--pal-line);
  background: var(--pal-panel);
}
.cd-reply .cd-text { font-size: 13px; margin-top: 7px; }
.cd-reply.is-d1 { margin-left: 20px; border-left: 2px solid rgba(212, 175, 55, .35); }
.cd-reply.is-d2 { margin-left: 40px; border-left: 2px solid rgba(212, 175, 55, .22); }
.cd-noreply {
  margin: 12px auto 0;
  max-width: 460px;
  text-align: center;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--pal-mut);
}
.cd-loading {
  margin: 44px auto 0;
  max-width: 300px;
  text-align: center;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 13px;
  color: var(--pal-mut);
}

/* 回帖按钮（每条回帖右下小幽灵钮） */
.cd-rbtn {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  margin: 6px 0 0;
  padding: 2px 6px;
  align-self: flex-start;
  color: var(--pal-gold-l);
  font-family: Nunito, system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  -webkit-tap-highlight-color: transparent;
}
.cd-rbtn:active { transform: translateY(1px); }

/* ---------- 回帖作曲器（八哥令：详情页必须能回帖跟帖）---------- */
.cd-composer {
  margin: 12px auto 0;
  max-width: 460px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, .32);
  background: var(--pal-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 回帖目标条（Replying to X ×） */
.cm-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 122, 176, .14);
  border: 1px solid rgba(255, 122, 176, .4);
  color: #FF9DC0;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
}
.cm-target[hidden] { display: none; }
.cm-target button {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  color: #FF9DC0;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.cm-input {
  appearance: none;
  border: 1px solid var(--pal-line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .35);
  color: var(--pal-txt, #F6EFE0);
  font-family: Nunito, system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 9px 11px;
  min-height: 58px;
  resize: vertical;
  outline: none;
}
.cm-input:focus { border-color: rgba(212, 175, 55, .55); }
.cm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cm-hint {
  font-family: Nunito, system-ui, sans-serif;
  font-size: 10.5px;
  color: var(--pal-mut);
}
.cm-send {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #D4AF37 0%, #F3DFA8 100%);
  color: #3B2C08;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .04em;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, opacity .12s ease;
}
.cm-send:active { transform: scale(.96); }
.cm-send[disabled] { opacity: .55; }

/* ===== 总指挥令 2026-10-24：iframe 加载态（绿线+小猴，与主站 site-loader 同款）=====
   标记字节级照搬 site-loader.js 的 MONKEY_SVG + loader-line（同绿 #3F7464、
   同 0.8s 跳动、同 1.2s 流线、同 180×2px）。铺 #0B0B0C 底——加载期间绝无白闪；
   iframe 本体也铺同款黑底（文档未画完前 iframe 自身不许露白）。 */
.cd-frame { background: var(--pal-ink); }
.cd-loader {
  position: absolute; left: 0; right: 0; top: 46px; bottom: 0;  /* 与 .cd-scroll 同几何 */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--pal-ink); z-index: 2; pointer-events: none;
}
.cd-loader[hidden] { display: none; }
.cd-loader .loader-monkey { display: block; width: 32px; height: 32px; color: #3F7464; animation: cdLoaderBob .8s ease-in-out infinite; }
.cd-loader .loader-monkey svg { width: 100%; height: 100%; display: block; }
@keyframes cdLoaderBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.cd-loader .loader-line {
  display: block; width: 180px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #E5E5E5 0%, #A8D5B5 50%, #E5E5E5 100%);
  background-size: 200% 100%; animation: cdLoaderFlow 1.2s linear infinite;
}
@keyframes cdLoaderFlow { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .cd-loader .loader-monkey, .cd-loader .loader-line { animation: none; } }

/* ===== 总指挥令 2026-10-24（图标统一令）：圆圈金＋与好友录 .fr-add 字节级同款 =====
   全 PWA 唯一允许的加号样式：42×42 正圆 + 1.5px 金发丝边 + 牌框底 + 亮金 26px 加；
   flex:none 禁挤压——圆圈加号永不变形（八哥令原纪律，照抄 .fr-add）。
   较原 30px 无圈Plain加整体放大一圈，头部空间更满、观感更稳；
   margin-right:8px——总指挥令「往里放一点」：加号右缘永离屏幕缘 ≥24px，不贴边。
   点击进发帖页（主站同一套系统黑金内嵌）；按下微缩与 .fr-add 同语言。 */
.ci-compose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;              /* 禁 flex 挤压——圆圈加号永不变形（宽=高=42px 正圆） */
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--pal-line);
  background: var(--pal-panel);
  color: var(--pal-gold-l);
  cursor: pointer;
  margin-right: 8px;       /* 往里放一点：离右缘留呼吸位 */
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .12s ease;
}
.ci-compose svg { width: 26px; height: 26px; display: block; }   /* 与 .fr-add 同大小 */
.ci-compose:active { transform: scale(.92); background: var(--pal-panel-2); }

/* ===== 总指挥令 2026-10-24：发帖弹层（共用系统，零新功能）=====
   fixed 全屏浮层 + 居中卡片，不动列表页任何布局。卡内 iframe 装主站
   show-and-tell?embed=1&compose=1（feed.js 发帖作曲器原样）。黑金语言：
   纯黑卡身 + 金色发丝边 + 金字标题 + 白 ×（与详情层 cd-top 同款）。 */
.ci-compose-pop {
  position: fixed; inset: 0; z-index: 960;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(11, 11, 12, .86);
}
.ci-compose-pop[hidden] { display: none; }
.ci-compose-card {
  position: relative;   /* 加载层的定位基准 */
  width: min(92vw, 430px); height: auto; max-height: 80vh;   /* 四令：高度随内容，不许页面滚动 */
  display: flex; flex-direction: column;
  background: var(--pal-ink); border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  animation: ciPop .22s cubic-bezier(.2, 1.2, .3, 1) both;
}
@keyframes ciPop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.ci-compose-top {
  flex: none; height: 46px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 16px; border-bottom: 1px solid rgba(212, 175, 55, .25);
}
.ci-compose-title {
  font-family: var(--pal-serif, serif); font-size: 15px; font-weight: 700;
  letter-spacing: .02em; color: var(--pal-gold-l, #F3DFA8);
}
.ci-compose-x {
  width: 38px; height: 38px; flex: none;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ci-compose-x svg { width: 20px; height: 20px; display: block; }
.ci-compose-frame { flex: none; height: 360px; width: 100%; border: 0; background: var(--pal-ink); display: block; }

/* ============================================================
   总指挥令 2026-10-24：圈子子栏目（Hot|Share）+ 发帖单页面层
   ——与数据页 Logbook/Standings/Frenemies 同款胶囊栏目条；
   Share 栏目 / 金色＋ 都原地切出整页发帖单页面（/compose），
   零弹窗、零 loader。旧 .ci-compose-pop 弹层已整体退役。
   ============================================================ */
/* 子栏目条：常规流插在 .ci-head 之下、列表之上（邀请页 #ivTabs 同款，
   严禁数据页那种 absolute 钉底写法）；flex:none 防 flex 拉伸变形 */
.ci-subtabs { flex: none; }
/* 发帖单页面层：占满栏目条以下全部空间（与 .cd-pane 同一几何哲学） */
.cs-pane {
  flex: 1 1 0;
  min-height: 0;
  position: relative;      /* iframe 绝对钉满的基准 */
  overflow: hidden;
  background: var(--pal-ink);   /* 空窗即墨黑，不闪白 */
}
.cs-pane[hidden] { display: none; }
.cs-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--pal-ink);
  display: block;
}

