/* chat-island.css — 对话页页头：「页眉细线」+ 点开的「信头」（10-15 第二十二批，主人：灵动岛和苹果自己的灵动岛冲突了，换掉）。
   平时：像书页顶上的页眉——一行字距很宽的名字，两边各一道细线，在线时名字前一颗小绿点；左边返回、右边「···」，都不带框。
   点一下（名字那一行或「···」）：往下展开成一封信的抬头——大字名字、在线状态、「看 ta 的主页 ›」，功能一排靠右、只留图标
   （语音、视频、搜聊天记录、换色、设置）；点别处、一滑、Esc 收回。顶部正中不再有任何「一块东西」，和系统灵动岛不抢。
   文件名、is-isl / isl-* 类名、D.chatIsland 都沿用灵动岛那一版（打开转场 chat-open.js 还在用），只是样子换了。
   都挂在 #app .ct-root.is-isl 下（id 级别，盖过 chat.css / paper.css / skin.css 里页头的写法）。 */

#app .ct-root.is-isl {
  --isl-ease: cubic-bezier(.22, 1, .36, 1);
  --isl-d: .3s;
  --isl-h: 44px;
  --isl-oh: 158px;   /* 信头展开后的高度 */
}

/* 页头只占一条：页眉高 44 + 上下 8，消息从它下面开始（chat.js 量页头高度设 --head-h） */
#app .ct-root.is-isl .ct-head { display: block; height: 60px; padding: 0; }

/* 顶上一层柔和的渐隐：消息滑上去时在页眉下面淡出 */
#app .ct-root.is-isl .ct-head::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 76px;
  background: linear-gradient(var(--cb-base, var(--surface)) 0%, var(--cb-base, var(--surface)) 50%, color-mix(in srgb, var(--cb-base, var(--surface)) 0%, transparent) 100%);
  pointer-events: none;
}

/* ---- 页眉那一条（原来的色块）：平时透明、整条可点；展开时变成信头那张纸 ---- */
#app .ct-root.is-isl .ct-head-bg {
  inset: auto;
  top: 8px;
  left: 0;
  width: 100%;
  height: var(--isl-h);
  border-radius: 0;
  transform: none;
  background-color: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  transition: none;
}
#app .ct-root.is-isl .ct-head.isl-ready .ct-head-bg {
  transition: top var(--isl-d) var(--isl-ease), height var(--isl-d) var(--isl-ease), border-radius var(--isl-d) var(--isl-ease),
    background-color .2s ease, box-shadow .25s ease;
}
#app .ct-root.is-isl .ct-head-bg::before, #app .ct-root.is-isl .ct-head-bg::after { display: none; }
#app .ct-root.is-isl .ct-wm { display: none; }
#app .ct-root.is-isl .ct-head.is-open .ct-head-bg {
  top: 0;
  height: var(--isl-oh);
  border-radius: 0 0 24px 24px;
  background-color: var(--cb-base, var(--surface));
  box-shadow: 0 0 0 100vmax var(--isl-scrim, rgba(40, 30, 20, .07)), 0 12px 28px rgba(60, 44, 24, .10);   /* 那一大圈影子就是遮罩：下面的消息淡一点；底下不画线（10-15 主人：点开后那条细线去掉） */
  cursor: default;
}
:root[data-theme="dark"] #app .ct-root.is-isl { --isl-scrim: rgba(0, 0, 0, .32); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #app .ct-root.is-isl { --isl-scrim: rgba(0, 0, 0, .32); } }

/* ---- 返回、「···」：不带框，只留图标 ---- */
#app .ct-root.is-isl .ct-head-bar { position: static; display: block; }
#app .ct-root.is-isl :is(.ct-back, .ct-isl-more) {
  position: absolute;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--ink);
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  transition: opacity .2s ease, transform .2s ease;
}
#app .ct-root.is-isl .ct-back { left: 4px; }
#app .ct-root.is-isl .ct-isl-more { right: 6px; display: flex; align-items: center; justify-content: center; }
.ct-isl-more { display: none; }
#app .ct-root.is-isl .ct-head.is-open .ct-isl-more { opacity: 0; pointer-events: none; }
#app .ct-root.is-isl :is(.ct-back, .ct-isl-more):active { transform: scale(.9); }

/* ---- 头像字：页眉和信头都不用（转场里飞着的那颗会在途中淡掉） ---- */
.ct-isl-ava, #app .ct-root.is-isl .ct-isl-ava { display: none; }

/* ---- 名字：平时一行字距很宽、两边细线；展开后大字靠左，下面是状态和「看 ta 的主页」 ---- */
#app .ct-root.is-isl .ct-head-title {
  position: absolute;
  top: 8px;
  left: 52px;
  right: 52px;
  height: var(--isl-h);
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}
#app .ct-root.is-isl .ct-head:not(.is-open) .ct-head-title::before,
#app .ct-root.is-isl .ct-head:not(.is-open) .ct-head-title::after { content: ''; flex: 0 1 46px; min-width: 10px; height: 1px; background: var(--line); }
#app .ct-root.is-isl .ct-name {
  align-self: center;
  max-width: 100%;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 5px;
  padding-left: 5px;   /* 抵掉最后一个字后面的字距，看着正中 */
  line-height: 1.25;
  transform: none;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
/* 在线小点：挪进标题那一行，排在名字前面 */
.ct-isl-dot { display: none; }
#app .ct-root.is-isl .ct-head-title .ct-isl-dot { display: none; flex: none; width: 6px; height: 6px; margin-right: -4px; border-radius: 50%; background: #3FA45B; }
#app .ct-root.is-isl .ct-head.isl-on:not(.is-open) .ct-head-title .ct-isl-dot { display: block; }
#app .ct-root.is-isl .ct-sub, #app .ct-root.is-isl .ct-isl-pf { display: none; }
#app .ct-root.is-isl .ct-sub { padding-left: 3px; }   /* 在线绿点带一圈 2px 的描边、状态行又是超出就裁：留 3px，绿点整颗露出来（10-15 主人：被遮住一部分） */

#app .ct-root.is-isl .ct-head.is-open .ct-head-title {
  top: 14px;
  left: 50px;
  right: 20px;
  height: auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  pointer-events: auto;
}
#app .ct-root.is-isl .ct-head.is-open .ct-name { align-self: flex-start; font-size: 24px; font-weight: 600; letter-spacing: .5px; padding-left: 0; line-height: 1.25; pointer-events: auto; }
#app .ct-root.is-isl .ct-head.is-open .ct-sub { display: block; max-height: none; margin-top: 3px; opacity: .8; font-family: var(--font-display); font-size: 12.5px; }
#app .ct-root.is-isl .ct-head.is-open .ct-isl-pf {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  padding: 2px 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--clay-d, var(--clay));
  cursor: pointer;
}

/* ---- 展开后：功能一排靠右，去掉边框只留图标（语音 / 视频由 calls.js 插在最前，接着搜索、换色、设置） ---- */
#app .ct-root.is-isl .ct-acts {
  position: absolute;
  right: 12px;
  top: calc(var(--isl-oh) - 54px);
  margin: 0;
  gap: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
#app .ct-root.is-isl .ct-acts .ct-hbtn { width: 44px; height: 44px; border-radius: 12px; background: none; box-shadow: none; color: var(--ink-2); }
#app .ct-root.is-isl .ct-acts .ct-hbtn::after { inset: 0; }
#app .ct-root.is-isl .ct-acts .ct-hbtn:active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
#app .ct-root.is-isl .ct-head.is-open .ct-acts { opacity: 1; transform: none; pointer-events: auto; }
#app .ct-root.is-isl .ct-head:not(.is-open) .ct-acts button { pointer-events: none; }

/* 情侣信头（致 某某 · 日期 · 火漆）：只在展开时出现在信头右上角 */
#app .ct-root.is-isl .pp-lhead { position: absolute; top: 20px; right: 20px; padding: 0; opacity: 0; transition: opacity .2s ease; }
#app .ct-root.is-isl .pp-lhead .pp-to { display: none; }
#app .ct-root.is-isl .ct-head.is-open .pp-lhead { opacity: 1; transition-delay: .14s; }
/* 群通话「加入」条：页眉下面一条小胶囊 */
#app .ct-root.is-isl .ct-callbar { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap; }

/* 极简：名字用墨色 */
:root[data-skin="minimal"] #app .ct-root.is-isl .ct-name { color: var(--ink); }

/* 减少动态：直接变 */
:root.reduce-motion #app .ct-root.is-isl :is(.ct-head-bg, .ct-head-title, .ct-name, .ct-sub, .ct-acts, .ct-back, .ct-isl-more) { transition: none; }

/* ---- 打开 / 返回转场里飞来飞去的那颗（chat-open.js 建在 #overlays 里，飞完就拿掉）：头像字在途中淡掉，名字落到页眉那一行 ---- */
.co-morph {
  position: absolute;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}
.co-ava { display: flex; flex: none; flex-direction: column; align-items: center; width: 26px; }
.co-ava span { font-family: var(--font-char); font-size: 20px; line-height: 1.3; will-change: transform; }
.co-ava i { display: block; width: 12px; height: 2px; margin-top: -3px; border-radius: 1px; }
.co-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: .3px; line-height: 1.25; transform-origin: 0 50%; will-change: transform; }

/* ---- 展开 / 收起的节奏：字先淡出 → 只变外形（那张纸往下展开 / 收回）→ 字在最终位置浮上来（chat-island.js 的 setOpen 管时间） ---- */
#app .ct-root.is-isl :is(.ct-head-title, .pp-lhead) { transition: opacity .18s ease, transform .24s cubic-bezier(.2, .8, .2, 1); }
#app .ct-root.is-isl .ct-acts { transition: opacity .18s ease .03s, transform .24s cubic-bezier(.2, .8, .2, 1) .03s; }
#app .ct-root.is-isl .ct-head.isl-hide :is(.ct-head-title, .ct-acts, .pp-lhead) { opacity: 0 !important; transform: translateY(3px); transition: opacity .07s ease, transform .07s ease; }

/* ================= 已绑定的情侣：「邮票地址」页头（10-15 主人）=================
   像信封上的地址：「致」+ 大字名字（下面一道写字的横线）+ 在线状态；右上角一枚斜贴的齿边邮票就是 ta 的头像（楷书字或圆角方块照片），点邮票进主页。
   点地址那一块照样展开成信头（功能都在里面）；情侣信头那一小块（日期 · 火漆）不再叠在右上角，有邮票了。 */
#app .ct-root.is-isl.is-letter .ct-head { height: 92px; }
#app .ct-root.is-isl.is-letter .ct-head::before { height: 112px; }
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-head-bg { top: 4px; height: 84px; }
#app .ct-root.is-isl.is-letter .ct-isl-more, #app .ct-root.is-isl.is-letter .pp-lhead { display: none; }
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-head-title {
  top: 10px; left: 50px; right: 92px; height: auto;
  flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0;
}
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-head-title::before,
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-head-title::after { display: none; }
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-head-title .ct-isl-dot { display: none; }
#app .ct-root.is-isl .ct-to { display: none; }
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-to { display: block; font-family: var(--font-display); font-size: 12px; letter-spacing: 2px; color: var(--muted); }
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-name {
  align-self: flex-start; min-width: 120px; margin-top: 1px; padding: 0 6px 5px 0;
  font-size: 22px; font-weight: 600; letter-spacing: .5px; line-height: 1.25;
  border-bottom: 1px solid var(--line);
}
#app .ct-root.is-isl.is-letter .ct-head:not(.is-open) .ct-sub { display: block; max-height: none; margin-top: 5px; opacity: .8; font-family: var(--font-display); font-size: 12px; }

/* 邮票：齿边（蒙版打孔）、里面一道发丝细框、微微斜贴 */
.ct-stamp { display: none; }
#app .ct-root.is-isl.is-letter .ct-stamp {
  display: block;
  position: absolute;
  top: 12px;
  right: 16px;
  width: 54px;
  height: 64px;
  padding: 4px;
  border: 0;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--c-soft) 32%, var(--surface));
  transform: rotate(3deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle, transparent 2.2px, #000 2.6px) -4px -4px / 8px 8px;
  mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle, transparent 2.2px, #000 2.6px) -4px -4px / 8px 8px;
  filter: drop-shadow(0 1px 1.5px rgba(90, 60, 30, .18));
  cursor: pointer;
  pointer-events: auto;   /* 页头默认点击穿透（chat.css），邮票要能点 */
  z-index: 1;
  transition: transform .2s ease;
}
#app .ct-root.is-isl.is-letter .ct-stamp:active { transform: rotate(3deg) scale(.94); }
#app .ct-root.is-isl.is-letter .ct-stamp-in {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--ink) 22%, transparent);
  overflow: hidden;
}
#app .ct-root.is-isl.is-letter .ct-stamp .ui-avatar { display: flex; flex-direction: column; align-items: center; }
#app .ct-root.is-isl.is-letter .ct-stamp .ui-ava-img { --size: 46px; width: 46px; height: 56px; border-radius: 0; }   /* 照片头像铺满邮票 */
#app .ct-root.is-isl.is-letter .ct-stamp .ui-avatar.has-img .ui-colorbar { display: none; }
