/* ============================================================
   ContextCall — 「洋流青 Current」UI v5 · iOS HIG
   契约:所有 ID / 类名 / body dataset 状态与 main.js 保持一致。
   ------------------------------------------------------------
   实施规格表(取自已批准的双平台 V4 设计稿,390px 基准,逐条对照):
   [色彩] tint #0B7A6D | live #2BD3BE | danger #EB4B42 | pro金 #E8B54A
          浅底 #F2F2F7 | 卡 #FFF | 主字 #111214 | 次字 #8A8A8E
          发丝线 rgba(60,60,67,.14) | 玻璃 rgba(28,28,30,.55)+blur20
   [入口] 大标题31/800 · 副题12.5 · 卡r14 · 行高≥50 图标29r8 文字15.5
          互换钮35圆 · 分段13/7pad · 节标12 · 邀请码12.5mono 复制14.5/600
          Pro行=普通行+金渐变图标+徽章10.5 · CTA h50 r14 16/600
          页脚11.5 · 抽屉46% r16 把手36×5 标题17/700 行15 开关50×30
   [通话] 顶部胶囊 12.5/600 pad8×13 r100 点6 · 顶距54 边距15
          小窗 w102 9:16 r14 环1px白.24 把手22×4 麦标17
          字幕 left20 right132 bottom152 · LIVE 9.5/700 声纹3条
          原声13/白.72 lh1.45 · 译文19/600白 lh1.42 关键词=live色
          坞 bottom32 玻璃r100 pad9×11 键49圆 图标20/1.8 挂断=danger
          遮罩 上115 下230 · 等待环44/2.5 · 提示11.5白.55
   [订阅] 网页版隐藏(body[data-store-shell="1"] 才显示) · 付费墙76%
   ============================================================ */

:root {
  color-scheme: light dark;

  /* --- 品牌「洋流」 --- */
  --tint: #0B7A6D;
  --tint-press: #096457;
  --tint-dim: rgba(11, 122, 109, 0.1);
  --live: #2BD3BE;
  --danger: #EB4B42;
  --warn: #FFB84D;
  --pro-a: #F2CC7B;
  --pro-b: #D89A2B;

  /* --- iOS 浅色语义 --- */
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --label: #111214;
  --sec: #8A8A8E;
  --ter: #C7C7CC;
  --hair: rgba(60, 60, 67, 0.14);
  --fill: rgba(118, 118, 128, 0.12);

  /* --- 通话页深色 --- */
  --glass: rgba(28, 28, 30, 0.55);
  --glass-blur: blur(20px) saturate(1.15);

  --r-card: 14px;
  --r-chip: 100px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 16px 36px -10px rgba(0, 0, 0, 0.7);
  --focus-ring: 0 0 0 3px rgba(11, 122, 109, 0.35);

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --call-chrome-top: calc(14px + var(--safe-t));
  --call-chrome-height: 38px;
}

* { box-sizing: border-box; }
html { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font-ui);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 原生化(WKWebView):禁长按放大镜/复制菜单、禁拖拽、禁双击缩放。
   捏合缩放由 viewport user-scalable=no 关闭。输入框例外见下。 */
html,
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
img,
svg,
video {
  -webkit-user-drag: none;
}
/* 例外:真正的输入框(如"加入通话"输码框)保留可输入/可选中 */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
body[data-call-active="true"] { background: #000; }
body[data-native-shell="true"] {
  width: 100vw;
  min-height: 100dvh;
  background: var(--bg);
  overscroll-behavior: none;
}
body[data-native-shell="true"][data-call-active="true"] { background: #000; }
body[data-theme-effective="dark"] {
  color-scheme: dark;
  --bg: #090B0D;
  --card: #171A1D;
  --label: #F4F5F6;
  --sec: #A6ADB4;
  --ter: #626A72;
  --hair: rgba(255, 255, 255, 0.12);
  --fill: rgba(255, 255, 255, 0.1);
  --tint-dim: rgba(43, 211, 190, 0.16);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.32);
}
body[data-theme-effective="dark"] input,
body[data-theme-effective="dark"] select {
  color-scheme: dark;
}
body[data-theme-effective="light"],
body[data-theme-effective="light"] input,
body[data-theme-effective="light"] select {
  color-scheme: light;
}
body[data-theme-effective="dark"] .ios-group,
body[data-theme-effective="dark"] .invite-field,
body[data-theme-effective="dark"] .sheet-list,
body[data-theme-effective="dark"] .perm-list,
body[data-theme-effective="dark"] .pay-feats,
body[data-theme-effective="dark"] .pay-plan {
  background: var(--card);
}
body[data-theme-effective="dark"] .settings-drawer[open]::before,
body[data-theme-effective="dark"] .perm-sheet .perm-dim,
body[data-theme-effective="dark"] .pay-sheet .pay-dim {
  background: rgba(0, 0, 0, 0.58);
}

h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
img, video { display: block; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.4; }
button.is-busy { opacity: 0.6; pointer-events: none; }
button:active { opacity: 0.75; }
button, .call-control, .call-language-swap, .custom-select-button, .entry-switch, summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:focus:not(:focus-visible),
.call-control:focus:not(:focus-visible),
.call-language-swap:focus:not(:focus-visible),
.custom-select-button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 8px; }

.is-hidden { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important; padding: 0 !important; margin: -1px !important;
}

/* 订阅 UI:纯网页版隐藏,壳工程设 data-store-shell="1" 后显示 */
body:not([data-store-shell="1"]) .store-only { display: none !important; }

/* LIVE 声纹(品牌动效基元:1.1s,三条) */
.wavemini { display: inline-flex; align-items: center; gap: 2px; height: 10px; }
.wavemini i {
  width: 2px; height: 100%; border-radius: 1px;
  background: var(--live);
  transform-origin: center;
  animation: wv 1.1s ease-in-out infinite;
}
.wavemini i:nth-child(2) { animation-delay: 0.15s; }
.wavemini i:nth-child(3) { animation-delay: 0.3s; }
@keyframes wv { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   布局骨架
   ============================================================ */
.app-shell {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
}
body[data-native-shell="true"] .app-shell {
  width: 100vw;
  max-width: none;
  margin: 0;
}

/* ---------- 顶栏:仅通话页可见(玻璃胶囊层) ---------- */
.topbar {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: calc(var(--call-chrome-top) + var(--call-chrome-height));
  padding: var(--call-chrome-top) 15px 0;
  pointer-events: none;
}
body[data-native-shell="true"] .topbar {
  left: 0;
  transform: none;
  max-width: none;
}
.topbar > div:first-child { pointer-events: auto; }
body:not([data-call-active="true"]) .topbar { display: none; }
.topbar .eyebrow, .topbar h1 { display: none; }
.topbar-wordmark { display: none; }

/* 状态胶囊(通话页右上,iOS 玻璃) */
/* CES V2:去胶囊外壳,仅保留状态圆点 + 文字(直接浮于画面,加阴影保可读) */
.status-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--call-chrome-height);
  gap: 7px;
  max-width: 52vw;
}
.status-pill span {
  flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.3s ease;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
}
.status-pill strong {
  font-size: 12.5px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
.status-pill[data-state="live"] span { background: var(--live); animation: blink 2s infinite; }
.status-pill[data-state="live"] strong { color: var(--live); }
.status-pill[data-state="arming"] span { background: var(--warn); animation: blink 1.2s infinite; }
.status-pill[data-state="blocked"] span { background: var(--danger); }
.status-pill[data-state="blocked"] strong { color: #ff9d97; }

/* ============================================================
   入口屏(control-panel)· iOS 浅色
   ============================================================ */
.control-panel {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(10px + var(--safe-t)) 18px calc(18px + var(--safe-b));
}
body[data-call-active="true"] .control-panel { display: none; }

/* ---------- 导航行:大标题 + 齿轮(设置抽屉入口) ---------- */
.entry-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 4px 6px;
}
.entry-nav .app-title {
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.entry-nav .app-title em { font-style: normal; color: var(--tint); }

.entry-caption {
  font-size: 12.5px;
  color: var(--sec);
  padding: 0 4px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pairblock {
  margin-top: 19px;
}

/* ---------- iOS 分组卡 ---------- */
.ios-group {
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  position: relative;
}
.ios-group.clip { overflow: hidden; }

.pair-row,
.ios-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  min-height: 52px;
}
.pair-row + .pair-row,
.ios-row + .ios-row {
  border-top: 0.5px solid var(--hair);
  margin-left: 15px;
  padding-left: 0;
  padding-right: 15px;
}
.row-ic {
  width: 29px; height: 29px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.row-ic svg { width: 15px; height: 15px; stroke: #fff; }
.row-ic.tint { background: var(--tint); }
.row-ic.live { background: var(--live); }
.row-ic.pro { background: linear-gradient(145deg, var(--pro-a), var(--pro-b)); }

.pair-row label {
  font-size: 15.5px;
  color: var(--label);
  flex: 1;
  cursor: pointer;
}
/* 语言值 = 原生 select,右对齐 + chevron,点击唤起系统选择器 */
.pair-select {
  border: 0;
  background: transparent;
  font-size: 15.5px;
  color: var(--sec);
  text-align: right;
  padding: 6px 20px 6px 0;
  margin-right: 30px; /* 给骑缝互换钮让位 */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23C7C7CC' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  cursor: pointer;
  max-width: 46vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pair-select:focus-visible { box-shadow: none; color: var(--tint); }
.pair-leader { display: none; }

/* 骑缝互换钮(#swapLanguagesButton) */
.swap-langs-row { display: contents; }
.swap-langs-button {
  position: absolute;
  right: 13px; top: 50%; transform: translateY(-50%);
  width: 35px; height: 35px; border-radius: 50%;
  background: var(--tint-dim);
  border: 1px solid rgba(11, 122, 109, 0.24);
  display: grid; place-items: center;
  z-index: 2;
  font-size: 0;
  transition: transform 0.15s ease;
}
.swap-langs-button:active { transform: translateY(-50%) scale(0.92); }
.swap-langs-button svg { width: 15px; height: 15px; stroke: var(--tint); }

/* ---------- 创建/加入 分段控件 ---------- */
.entry-panel { margin-top: 33px; }
.entry-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--fill);
  border-radius: 9px;
  padding: 2px;
}
.mode-button {
  text-align: center;
  padding: 7px 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  transition: background 0.15s ease;
}
.mode-button.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  font-weight: 600;
}
body[data-theme-effective="dark"] .mode-button.is-active {
  background: rgba(255, 255, 255, 0.14);
}

.entry-sect {
  font-size: 12px;
  color: var(--sec);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 18px 7px;
}

/* ---------- 邀请 / 粘贴共享行位 ---------- */
.invite-panel, .join-code-panel { padding: 0; }
body:not([data-entry-mode="join"]) .join-code-panel { display: none; }
body[data-entry-mode="join"] .invite-panel { display: none; }

.invite-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 12px 15px;
  min-height: 50px;
}
.invite-field input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; padding: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--sec);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.invite-field input:focus { outline: none; box-shadow: none; }
.copy-inline {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tint);
}
.copy-inline .icon svg { width: 14px; height: 14px; stroke: var(--tint); }
.field-hint { display: none; }

/* ---------- Pro 订阅入口(壳内显示) ---------- */
.pro-row { margin-top: 12px; }
.pro-row .pro-k { font-size: 15.5px; flex: 1; }
.pro-row .pro-k small { display: block; font-size: 12px; color: var(--sec); margin-top: 1px; }
.pro-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  color: #8A5A00; background: rgba(232, 181, 74, 0.22);
  border-radius: 6px; padding: 2px 7px; margin-left: 6px;
  vertical-align: 1px;
}
.pro-row .chev { flex: none; }
.pro-row .chev svg { width: 12px; height: 12px; stroke: var(--ter); }

/* ---------- 主 CTA ---------- */
.call-actions {
  margin-top: auto;
  padding-top: 0;
  display: block;
}
button.primary {
  width: 100%;
  height: 50px;
  border-radius: var(--r-card);
  background: var(--tint);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px -10px rgba(11, 122, 109, 0.5);
  transition: transform 0.12s ease, background 0.2s ease;
}
button.primary .icon {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}
button.primary .icon svg {
  display: block;
}
button.primary:active { transform: scale(0.985); background: var(--tint-press); opacity: 1; }
button.primary .icon svg { width: 17px; height: 17px; }
button.secondary { display: none; } /* 结束按钮:通话页挂断替代 */

/* ---------- 页脚 ---------- */
.legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.legal-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 11.5px;
  color: var(--tint);
}
.legal-links a + a::before { content: "·"; color: var(--ter); margin-right: 8px; }
.legal-links a svg { display: none; }

/* ---------- 通知(iOS 浮层) ---------- */
.notice {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(18px + var(--safe-b));
  z-index: 70;
  width: min(92vw, 520px);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--r-card);
  padding: 12px 16px;
  font-size: 13px;
  color: #fff;
  box-shadow: var(--shadow-float);
}

/* ============================================================
   iOS 底部抽屉(设置 46% / 权限预说明 / 付费墙 76%)
   ============================================================ */
.settings-drawer { position: static; }
.settings-drawer > summary {
  list-style: none;
  width: 33px; height: 33px;
  border-radius: 50%;
  background: var(--fill);
  display: grid; place-items: center;
  cursor: pointer;
  user-select: none;
}
.settings-drawer > summary::-webkit-details-marker { display: none; }
.settings-drawer > summary::marker { content: ""; }
.settings-drawer > summary svg { width: 17px; height: 17px; stroke: var(--sec); }
.settings-drawer[open] > summary { background: var(--tint-dim); }
.settings-drawer[open] > summary svg { stroke: var(--tint); }
/* 遮罩 */
.settings-drawer[open]::before {
  content: "";
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 80;
}
.settings-menu {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 560px;
  height: auto;
  max-height: min(46%, 360px);
  min-height: 0;
  z-index: 85;
  background: #F7F7FA;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  padding: 8px 16px calc(18px + var(--safe-b));
  display: flex;
  flex-direction: column;
}
body[data-theme-effective="dark"] .settings-menu {
  background: #15171A;
}
.settings-menu::before {
  content: "";
  width: 36px; height: 5px; border-radius: 3px;
  background: var(--ter);
  margin: 4px auto 10px;
  flex: none;
}
.sheet-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 10px;
  flex: none;
}
.sheet-title h4 { font-size: 17px; font-weight: 700; margin: 0; }
.sheet-done { font-size: 15px; color: var(--tint); font-weight: 600; cursor: pointer; }
.sheet-list {
  background: #fff;
  border-radius: 12px;
  overflow: auto;
  flex: none;
}
.panel-row, .sheet-li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  font-size: 15px;
  min-height: 46px;
}
.sheet-list .panel-row + .panel-row,
.sheet-list .panel-row + .toggle,
.sheet-list .toggle + .panel-row,
.sheet-list .sheet-li + .sheet-li,
.sheet-list * + .panel-row,
.sheet-list * + .toggle {
  border-top: 0.5px solid var(--hair);
  margin-left: 15px;
  padding-left: 0;
  padding-right: 15px;
}
.settings-menu .panel-row label { font-size: 15px; color: var(--label); }
.native-select-proxy {
  display: none !important;
}

.custom-select {
  flex: none;
  min-width: 0;
}
.custom-select-button {
  min-height: 34px;
  border-radius: 10px;
  color: var(--sec);
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  line-height: 1.2;
  text-align: right;
  padding: 5px 0 5px 10px;
  max-width: 100%;
}
.custom-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-chevron {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  color: var(--ter);
}
.custom-select-chevron::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}
.custom-select-button[aria-expanded="true"] .custom-select-chevron::before {
  transform: rotate(225deg) translate(-1px, -1px);
}
.panel-row .custom-select {
  margin-left: auto;
  max-width: 56%;
}
.panel-row .custom-select-button {
  width: 100%;
  justify-content: end;
}
.pair-row .custom-select {
  margin-right: 30px;
  max-width: 46vw;
}
.pair-row .custom-select-button {
  font-size: 15.5px;
  max-width: 46vw;
}
.call-language-picker .custom-select-button {
  min-height: 26px;
  max-width: 100%;
  /* chevron 已隐藏,改单列布局:不再为 chevron 保留 14px,选中语言真正水平居中 */
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 600;
  text-align: center;
  padding: 4px 8px;
}
.call-language-picker .custom-select-chevron {
  display: none;
}
.custom-select-layer {
  position: fixed;
  z-index: 130;
  display: none;
  padding: 7px;
  border-radius: 16px;
  background: var(--card);
  color: var(--label);
  border: 1px solid var(--hair);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.custom-select-layer.is-open {
  display: block;
}
.custom-select-option {
  width: 100%;
  min-height: 42px;
  border-radius: 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  color: var(--label);
  text-align: left;
}
.custom-select-option + .custom-select-option {
  margin-top: 2px;
}
.custom-select-option.is-selected,
.custom-select-option:hover {
  background: var(--tint-dim);
}
.custom-select-option-main {
  min-width: 0;
}
.custom-select-option-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-option-desc {
  display: block;
  margin-top: 2px;
  color: var(--sec);
  font-size: 12px;
  line-height: 1.35;
}
.custom-select-check {
  color: var(--tint);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
}
.custom-select-option.is-selected .custom-select-check {
  opacity: 1;
}
body[data-theme-effective="dark"] .custom-select-layer {
  background: #171A1D;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58);
}

/* iOS 开关(#echoTarget) */
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 15px;
  min-height: 46px;
  cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle strong { font-size: 15px; font-weight: 400; color: var(--label); flex: 1; order: -1; }
.toggle span {
  flex: none;
  position: relative;
  width: 50px; height: 30px;
  border-radius: 16px;
  background: rgba(118, 118, 128, 0.32);
  transition: background 0.25s ease;
}
.toggle span::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toggle input:checked + span { background: #34C759; }
.toggle input:checked + span::after { transform: translateX(20px); }
body[data-theme-effective="dark"] .toggle span {
  background: rgba(120, 120, 128, 0.38);
}
body[data-theme-effective="dark"] .toggle span::after {
  background: #F4F5F6;
}

/* 电平 + 遥测 */
.meter {
  height: 4px;
  border-radius: 2px;
  background: rgba(118, 118, 128, 0.2);
  overflow: hidden;
  flex: 1;
  margin: 0 15px 0 0;
}
.settings-menu .meter { margin: 14px 15px; flex: none; }
.meter span {
  display: block; height: 100%; width: 0%;
  border-radius: 2px;
  background: var(--live);
  transition: width 0.12s linear;
}
.telemetry-cache {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--sec);
  border-top: 0.5px solid var(--hair);
  margin-left: 15px;
  padding-left: 0;
}
.telemetry-cache strong { font-weight: 500; }
.quality-row strong { color: var(--sec); }
.quality-row[data-state="good"] strong,
.quality-row[data-state="ok"] strong,
.quality-row[data-state="live"] strong { color: var(--tint); font-weight: 600; }
.quality-row[data-state="bad"] strong,
.quality-row[data-state="blocked"] strong { color: var(--danger); }
.quality-row[data-state="busy"] strong,
.quality-row[data-state="arming"] strong { color: #C77800; }

/* ---------- 权限预说明 Sheet ---------- */
.perm-sheet {
  position: fixed; inset: 0;
  z-index: 90;
  display: none;
}
.perm-sheet.open { display: block; }
.perm-sheet .perm-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); }
.perm-sheet .perm-body {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 560px;
  background: #F7F7FA;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  padding: 8px 16px calc(18px + var(--safe-b));
}
.perm-sheet .perm-body::before {
  content: "";
  display: block;
  width: 36px; height: 5px; border-radius: 3px;
  background: var(--ter);
  margin: 4px auto 10px;
}
.perm-sheet h4 { font-size: 17px; font-weight: 700; padding: 2px 4px 10px; margin: 0; }
.perm-list { background: #fff; border-radius: 12px; }
.perm-item {
  display: flex; gap: 13px; padding: 13px 15px; align-items: flex-start;
}
.perm-item + .perm-item { border-top: 0.5px solid var(--hair); margin-left: 15px; padding-left: 0; }
.perm-item .pic {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--tint-dim);
  display: grid; place-items: center;
  flex: none;
}
.perm-item .pic svg { width: 18px; height: 18px; stroke: var(--tint); }
.perm-item b { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.perm-item span { font-size: 12.5px; color: var(--sec); line-height: 1.5; }
.perm-continue {
  width: 100%;
  margin-top: 12px;
  height: 48px;
  border-radius: 13px;
  background: var(--tint);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.perm-later {
  width: 100%;
  text-align: center;
  padding: 12px 0 0;
  font-size: 14px;
  color: var(--sec);
}

body[data-theme-effective="dark"] .perm-sheet .perm-body,
body[data-theme-effective="dark"] .pay-sheet .pay-body {
  background: #15171A;
  color: var(--label);
}
body[data-theme-effective="dark"] .perm-item + .perm-item,
body[data-theme-effective="dark"] .pay-feat + .pay-feat {
  border-top-color: var(--hair);
}
body[data-theme-effective="dark"] .perm-item span,
body[data-theme-effective="dark"] .pay-hero span,
body[data-theme-effective="dark"] .pay-plan .pl span,
body[data-theme-effective="dark"] .pay-plan .pr span,
body[data-theme-effective="dark"] .pay-fine {
  color: var(--sec);
}
body[data-theme-effective="dark"] .perm-sheet .perm-body::before,
body[data-theme-effective="dark"] .pay-body::before {
  background: var(--ter);
}
body[data-theme-effective="dark"] .pay-plan {
  border-color: var(--hair);
}

/* ---------- 付费墙(壳内,76%) ---------- */
.pay-sheet { position: fixed; inset: 0; z-index: 90; display: none; }
.pay-sheet.open { display: block; }
.pay-sheet .pay-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); }
.pay-sheet .pay-body {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 560px;
  height: 76%;
  background: #F7F7FA;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  padding: 8px 16px calc(16px + var(--safe-b));
  display: flex; flex-direction: column;
  overflow: auto;
}
.pay-body::before {
  content: "";
  width: 36px; height: 5px; border-radius: 3px;
  background: var(--ter);
  margin: 4px auto 10px;
  flex: none;
}
.pay-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 14px; flex: none; }
.pay-hero .crown {
  width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(145deg, var(--pro-a), var(--pro-b));
  display: grid; place-items: center;
  box-shadow: 0 10px 24px -10px rgba(216, 154, 43, 0.5);
}
.pay-hero .crown svg { width: 26px; height: 26px; stroke: #fff; }
.pay-hero b { font-size: 20px; font-weight: 800; }
.pay-hero span { font-size: 13px; color: var(--sec); }
.pay-feats { background: #fff; border-radius: 12px; margin-bottom: 12px; flex: none; }
.pay-feat { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px; }
.pay-feat + .pay-feat { border-top: 0.5px solid var(--hair); margin-left: 14px; padding-left: 0; }
.pay-feat svg { width: 16px; height: 16px; stroke: var(--tint); flex: none; }
.pay-plans { display: flex; flex-direction: column; gap: 9px; flex: none; }
.pay-plan {
  background: #fff;
  border-radius: 13px;
  border: 1.5px solid rgba(60, 60, 67, 0.16);
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.pay-plan.sel { border-color: var(--tint); box-shadow: 0 0 0 3px rgba(11, 122, 109, 0.12); }
.pay-plan .pl b { display: block; font-size: 15px; font-weight: 700; }
.pay-plan .pl b em {
  font-style: normal; font-size: 10.5px; font-weight: 700;
  color: #8A5A00; background: rgba(232, 181, 74, 0.25);
  border-radius: 5px; padding: 1.5px 6px; margin-left: 6px;
  vertical-align: 1px;
}
.pay-plan .pl span { font-size: 12px; color: var(--sec); }
.pay-plan .pr { font-size: 15px; font-weight: 700; text-align: right; }
.pay-plan .pr span { display: block; font-size: 11px; font-weight: 400; color: var(--sec); }
.pay-cta {
  width: 100%;
  margin-top: 12px;
  height: 48px;
  border-radius: 13px;
  background: var(--tint);
  color: #fff;
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.pay-fine { font-size: 10.5px; color: var(--sec); line-height: 1.55; text-align: center; padding: 10px 6px 0; flex: none; }
.pay-links { display: flex; justify-content: center; gap: 14px; padding-top: 8px; font-size: 12.5px; color: var(--tint); font-weight: 500; flex: none; }
.pay-links i { font-style: normal; color: var(--ter); }

/* ============================================================
   通话舞台 · 深色全屏
   ============================================================ */
.stage { display: none; }
body[data-call-active="true"] .stage {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: #000;
}
body[data-native-shell="true"][data-call-active="true"] .stage {
  width: 100vw;
  min-height: 100dvh;
}

/* Native iOS media composition: the 1.1(43) WebView remains the UI layer.
   Only the video/background surfaces become transparent so the native remote
   renderer below can show through. Controls, language chrome, status and
   captions stay in the WebView and remain interactive. */
body[data-native-media-active="true"] {
  background: transparent !important;
}
body[data-native-media-active="true"] .app-shell,
body[data-native-media-active="true"] .stage,
body[data-native-media-active="true"] .call-grid,
body[data-native-media-active="true"] .video-pane,
body[data-native-media-active="true"] .remote-empty,
body[data-native-media-active="true"] .cc2-connect-stage {
  background: transparent !important;
}
body[data-native-media-active="true"] .in-call-controls,
body[data-native-media-active="true"] .call-langbar,
body[data-native-media-active="true"] .status-pill {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}
body[data-call-connected="true"][data-call-controls="hidden"] .topbar > div:first-child {
  opacity: 0;
  pointer-events: none;
}

/* ---------- 视频层(z1) ---------- */
.call-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #000;
  overflow: hidden;
}
.video-pane {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}
.video-pane video { width: 100%; height: 100%; object-fit: cover; }
#remoteVideo {
  opacity: 0;
  transition: opacity 0.2s ease;
}
#remoteVideo.live { opacity: 1; }
/* Stream termination must hide immediately; only entry into .live fades in. */
#remoteVideo:not(.live) { opacity: 0; transition: none; }
video::-webkit-media-controls,
video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}
/* Keep entry branding separate from the approved call-state aperture artwork. */
.stage .cc-aperture,
.stage .brand-aperture-bg {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
}
/* 本地自视图镜像:前置摄像头像照镜子(仅显示层,不影响发送给对方的画面);
   后置摄像头与远端画面永不镜像。data-camera-facing 由 updateCameraControls 维护。 */
body[data-camera-facing="user"] #localVideo { transform: scaleX(-1); }
/* 影院暗角:仅为字幕/胶囊可读性 */
.video-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 14%),
    linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.18) 27%, transparent 40%);
}
body[data-call-connected="true"] .video-pane::after {
  display: none;
  background: transparent;
}
.video-pane.main-video { inset: 0; z-index: 1; }

/* ---------- 小窗(z30):9:16 竖向,默认右下停靠 ---------- */
.video-pane.pip-video {
  inset: auto;
  top: auto;
  right: 15px;
  bottom: 252px;
  left: auto;
  width: 102px;
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 14px;
  border: 0;
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(255, 255, 255, 0.24);
  z-index: 30;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.video-pane.pip-video::after { display: none; }
/* 小窗顶部拖拽把手 */
.video-pane.pip-video::before {
  content: "";
  position: absolute;
  top: 5px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
  z-index: 2;
}
.video-pane.pip-video.is-positioned {
  top: var(--pip-top);
  left: var(--pip-left);
  right: auto;
  bottom: auto;
}
.video-pane.pip-video.is-pip-collapsed {
  width: 34px !important;
  min-width: 34px;
  max-width: 34px;
  height: 104px !important;
  aspect-ratio: auto;
  background: rgba(28, 28, 30, 0.72);
  box-shadow: var(--shadow-float);
  cursor: pointer;
  border-radius: 17px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.video-pane.pip-video.is-pip-collapsed video,
.video-pane.pip-video.is-pip-collapsed .pane-overlay,
.video-pane.pip-video.is-pip-collapsed::before {
  opacity: 0;
}
.video-pane.pip-video.is-pip-edge-left,
.video-pane.pip-video.is-pip-edge-right { border-radius: 17px; }

/* 初始态:远端主画面,本地小窗 */
.remote-pane:not(.pip-video) { inset: 0; z-index: 1; }
.local-pane:not(.main-video):not(.pip-video) {
  inset: auto;
  top: auto;
  right: 15px;
  bottom: 252px;
  width: 102px;
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 14px;
  box-shadow: none;
  z-index: 30;
}
.local-pane:not(.main-video)::after { display: none; }
body[data-camera-switching="true"] .local-pane {
  background: #050607;
}
body[data-camera-switching="true"] .local-pane::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(130, 246, 221, 0.92);
  animation: spin 900ms linear infinite;
  z-index: 1;
  pointer-events: none;
}

/* 角落标签隐藏(节点保留供 JS 写入) */
.pane-overlay { display: none !important; }
.swap-button { display: none !important; }

/* 小窗折叠手柄 */
.pip-drawer-toggle {
  display: none !important;
}

/* ---------- 等待对方(#remoteEmpty 重构) ---------- */
.remote-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 40px 286px;
  text-align: center;
  background:
    radial-gradient(400px 300px at 50% 30%, rgba(43, 211, 190, 0.06), transparent 65%),
    rgba(0, 0, 0, 0.35);
}
.remote-empty::before {
  content: "";
  width: 44px; height: 44px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--live);
  animation: spin 1.1s linear infinite;
  margin-bottom: 4px;
}
.remote-empty strong {
  font-size: 17px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}
.remote-empty span {
  font-size: 12.5px; color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
body[data-call-connected="true"] .remote-empty { display: none; }

/* ---------- 字幕(z40):左对齐,恒浮于小窗之上 ---------- */
.transcript-band {
  position: absolute;
  left: 20px;
  right: 132px;   /* 小窗停靠通道 */
  bottom: 172px;
  z-index: 40;
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  overflow: visible;
  text-align: left;
  pointer-events: none;
  box-shadow: none;
  outline: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* 字幕关:只隐两张字幕卡(Primary 译文 + Secondary 原文),保留 cc2-state-row(AI 在场:光圈+状态文字) */
body[data-captions="off"] .caption-card { display: none; }
/* 控制隐藏(沉浸)时字幕下移贴近底部 */
body[data-call-connected="true"][data-call-controls="hidden"] .transcript-band { bottom: calc(60px + var(--safe-b)); }
body[data-call-connected="true"][data-call-controls="hidden"] .video-pane.pip-video:not(.is-positioned) { bottom: calc(60px + var(--safe-b)); }

/* 旧 LIVE 标识(.stream-head/.stream-title/.wave)已随 DOM 移除:功能由 CES V2 四态(cc2-state-row)替代 */

.caption-card {
  position: relative;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.caption-card::before { display: none; }
.caption-card > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.caption-card p {
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: normal;
  margin: 0;
}

/* CES V2 · C3 Secondary(原文,--cc-type-subtitle-2) */
.source-caption p {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--cc-text-secondary);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.92), 0 0 20px rgba(0, 0, 0, 0.55);
  max-height: 60px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
/* Part 3.4 间距:State→Primary 10 / Primary→Secondary 8(Primary 在上) */
.translation-caption { margin-top: 10px; border: 0; }
.source-caption { margin-top: 8px; }
/* CES V2 · C3 Primary(译文,你的语言,--cc-type-subtitle 23/30 700) */
.translation-caption p {
  font-size: 23px;
  line-height: 30px;
  font-weight: 700;
  color: var(--cc-text-primary);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.95), 0 0 26px rgba(0, 0, 0, 0.6);
  max-height: 90px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
/* M-SUB:整段提交 = sentence settle(非逐字);新行 fade+translateY 6→0 */
@keyframes cc2-sub-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.translation-caption p.cc2-sub-in { animation: cc2-sub-in var(--cc-dur-standard) var(--cc-ease-settle) 1; }
.caption-card p[data-empty="true"] {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12.5px;
  font-weight: 400;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
body[data-call-connected="true"] .translation-caption p[data-empty="false"]::after {
  content: "";
  display: inline-block;
  width: 2px; height: 0.95em;
  background: var(--live);
  vertical-align: -2px;
  margin-left: 3px;
  animation: caretblink 1s steps(1) infinite;
}
@keyframes caretblink { 50% { opacity: 0; } }
body[data-call-active="true"]:not([data-call-connected="true"]) .transcript-band .caption-card { opacity: 0.45; }

/* ---------- 语言胶囊(通话页左上,z50) ---------- */
body[data-call-active="true"] .topbar-langslot { pointer-events: auto; }
.call-langbar {
  position: absolute;
  top: var(--call-chrome-top);
  left: 15px;
  z-index: 25;
  display: none;
  /* 两个等宽语言槽 + 中间的 ⇄:grid 保证 ⇄ 恒在正中,不受 select 各自内容宽度影响 */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 2px;
  min-height: var(--call-chrome-height);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--r-chip);
  width: 108px;
  max-width: calc(100vw - 30px);
  padding: 2px 5px;
}
body[data-call-active="true"] .call-langbar { display: grid; }

.call-language-picker { display: flex; align-items: center; justify-content: center; min-width: 0; }
.call-language-picker > span[data-i18n] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.call-language-swap {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--live);
  background: rgba(255, 255, 255, 0.12);
  margin: 0;
}
.call-language-swap svg {
  width: 14px;
  height: 14px;
}
.call-language-picker select {
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 0;
  background-image: none;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-langbar .custom-select { min-width: 34px; max-width: 42px; }
.call-langbar .custom-select-button {
  min-height: 30px;
  padding: 5px 6px;
  justify-content: center;
  gap: 0;
}
.call-langbar .custom-select-value {
  overflow: visible;
  text-overflow: clip;
}
.call-langbar .custom-select-chevron { display: none; }

/* ---------- 控制坞(z50):FaceTime 式玻璃 ---------- */
.in-call-controls {
  position: relative;
  z-index: 50;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 calc(28px + var(--safe-b));
  background: transparent;
}
/* ============================================================
   CES V2 · P1 · chrome auto-hide(M-CHROME,Part 6)
   淡出集合仅:C6 控制栏 + C7 语言胶囊;C8 状态始终常驻右上。
   字幕层(T2:.cc2-state-row / Primary / Secondary)不随 chrome 隐藏——始终可见。
   ============================================================ */
.in-call-controls,
.call-langbar {
  transition: opacity var(--cc-dur-quick, 200ms) var(--cc-ease-soft), transform var(--cc-dur-quick, 200ms) var(--cc-ease-soft);
}
body[data-call-connected="true"][data-call-controls="hidden"] .in-call-controls,
body[data-call-connected="true"][data-call-controls="hidden"] .call-langbar {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
/* error / 连接 / 重连态:chrome 与"重试/结束"入口必须常显,绝不 auto-hide(用户正需要它们) */
body[data-cc-error] .in-call-controls,
body[data-cc-error] .call-langbar,
body[data-cc-error] .status-pill,
body[data-cc-presence="CONNECTING"] .in-call-controls,
body[data-cc-presence="RECONNECTING"] .in-call-controls,
body[data-cc-presence="RECONNECTING"] .call-langbar,
body[data-cc-presence="RECONNECTING"] .status-pill {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  .in-call-controls, .call-langbar, .status-pill { transition: none !important; }
}

/* CES V2 · C6 Control Bar —— Part 3.6 尺寸 + CES tokens;顺序 Mic·Camera·Flip·Captions·End */
.dock-group {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--cc-glass);
  backdrop-filter: blur(var(--cc-blur-glass));
  -webkit-backdrop-filter: blur(var(--cc-blur-glass));
  border: 1px solid var(--cc-hairline);
  border-radius: var(--cc-radius-pill);
  box-shadow: var(--cc-elev-bar);
  padding: 11px 14px;
  max-width: calc(100vw - 20px);
}
.call-control {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--cc-text-primary);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background var(--cc-dur-quick) var(--cc-ease-soft), color var(--cc-dur-quick) var(--cc-ease-soft), transform var(--cc-dur-instant) var(--cc-ease-soft);
}
.call-control:focus:not(:focus-visible) { box-shadow: none; }
.call-control:active { transform: scale(0.93); opacity: 1; }
.call-control .icon svg { width: 20px; height: 20px; }
/* 关闭态图标:mic-off / cam-off 跟随现有 .is-active(main.js 在静音/关视频时维护,零新状态) */
.call-control .cc-ico-off { display: none; }
.call-control.is-active .cc-ico-on { display: none; }
.call-control.is-active .cc-ico-off { display: block; }
/* 字幕键:开(aria-pressed=true)=cc + mint 高亮;关(false)=cc-off + 常规白色 */
#captionsToggleButton[aria-pressed="false"] .cc-ico-on { display: none; }
#captionsToggleButton[aria-pressed="false"] .cc-ico-off { display: block; }
#captionsToggleButton[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); color: var(--cc-accent-mint); }
/* 状态:字幕键按下=反色;静音/关视频=危险红(状态经 aria-pressed,main.js 维护) */
.call-control[aria-pressed="true"] { background: #fff; color: #111; }
#muteMicButton[aria-pressed="true"],
#toggleVideoButton[aria-pressed="true"] { background: var(--cc-status-error); color: #fff; }
#flipCameraButton.is-camera-switching { background: #fff; color: #111; }
#flipCameraButton:disabled { opacity: 0.45; }
.control-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* End:危险色、最右、+8pt 间距 + 1px 分隔(防误触,Part 3.6) */
.end-call-control {
  width: 48px; height: 48px;
  margin-left: 8px;
  background: var(--cc-status-error);
  color: #fff;
}
.end-call-control::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  width: 1px; height: 26px;
  transform: translateY(-50%);
  background: var(--cc-hairline);
}
.end-call-control:active { background: #e05a5a; }
.end-call-control[aria-pressed="true"] { background: var(--cc-status-error); color: #fff; }
.end-call-control .icon svg { width: 22px; height: 22px; }

/* 沉浸提示 */
.tap-hint {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(28px + var(--safe-b));
  z-index: 50;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  display: none;
  pointer-events: none;
}
body[data-call-connected="true"][data-call-controls="hidden"] .tap-hint { display: block; }

/* ============================================================
   桌面适配 + 动效降级
   ============================================================ */
@media (min-width: 640px) {
  body { background: #E9E9EE; }
  body[data-call-active="true"] { background: #000; }
  .app-shell {
    background: var(--bg);
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(60, 60, 67, 0.1);
  }
  body[data-call-active="true"] .app-shell { background: #000; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   Entry Experience E1 — 品牌落地(冻结资产 V8/V9/E1 忠实实现)
   作用域全部限定在 .control-panel:token 与配色只作用于入口屏,
   通话舞台与设置弹层不受影响(交接文档 D4)。深色沿用
   body[data-theme-effective="dark"],夜间模式开关继续可用。
   ============================================================ */
.control-panel {
  --cc-deep: #0A4A44;
  --cc-teal: #0F766E;
  --cc-mint: #2DD4BF;
  --cc-sand: #F5F2EC;
  --cc-ink: #0B1513;
  --cc-paper: #FBFAF6;
  --cc-line: #EAE3D6;
  --cc-line-strong: #D9D2C2;
  --cc-sub: #5F6B68;
  --cc-arc: var(--cc-deep);
  --cc-ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --cc-ease-breath: cubic-bezier(0.65, 0, 0.35, 1);
  --cc-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--cc-sand);
  color: var(--cc-ink);
  padding: calc(12px + var(--safe-t)) 24px calc(18px + var(--safe-b));
}
/* 入口态时 body 底色同步为 Sand,避免橡皮筋滚动露出旧灰底 */
body:not([data-call-active="true"]) { background: var(--cc-sand); }

/* ---------- 光圈 Logo(V8 冻结几何) ---------- */
.control-panel .cc-aperture { display: block; }
.control-panel .cc-aperture .cc-arc,
.control-panel .cc-aperture .cc-node {
  transform-box: view-box;
  transform-origin: 512px 512px;
}
.control-panel .cc-aperture .cc-arc { stroke: var(--cc-arc); }
.control-panel .cc-aperture .cc-node { fill: var(--cc-mint); }
.control-panel .cc-aperture .cc-node {
  animation: cc-breath 2.8s var(--cc-ease-breath) infinite;
}
/* Fix 3:仅 Hero 大光圈双弧持续反向慢转(6s/圈,V9 Loading 母题);顶栏小 Logo 不转 */
.control-panel .cc-aperture-lg .cc-arc.top { animation: cc-rot 6s linear infinite; }
.control-panel .cc-aperture-lg .cc-arc.bot { animation: cc-rot-rev 6s linear infinite; }
@keyframes cc-breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes cc-rot { to { transform: rotate(360deg); } }
@keyframes cc-rot-rev { to { transform: rotate(-360deg); } }
.control-panel .cc-aperture-sm { width: 26px; height: 26px; }
.control-panel .cc-aperture-lg { width: 78px; height: 78px; margin: 0 auto; }

/* ---------- Brand presence ---------- */
.control-panel .entry-nav { align-items: center; padding: 4px 2px 2px; }
.control-panel .brand-lockup { display: flex; align-items: center; gap: 9px; }
.control-panel .entry-nav .app-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.control-panel .entry-nav .app-title em { color: var(--cc-teal); }
/* Fix 1:设置钮 —— 系统 ⚙️ emoji 置于 44×44 白盘容器 */
.control-panel .settings-drawer > summary {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid #ece7db;
}
.control-panel .settings-drawer > summary .settings-glyph { font-size: 22px; line-height: 1; }

/* ---------- Hero ---------- */
.control-panel .entry-hero {
  text-align: center;
  margin-top: 24px;
  animation: cc-enter 0.7s var(--cc-ease-settle) both;
}
@keyframes cc-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.control-panel .entry-hero-title {
  font-size: 27px;
  line-height: 1.16;
  letter-spacing: -0.5px;
  font-weight: 700;
  margin: 16px 0 0;
  color: var(--cc-ink);
}
.control-panel .entry-hero-title span { display: block; }
.control-panel .entry-hero-title b { display: block; color: var(--cc-teal); font-weight: 700; }
.control-panel .entry-hero-sub {
  color: var(--cc-sub);
  font-size: 14px;
  margin: 9px 0 0;
}

/* ---------- Language Bridge ---------- */
.control-panel .pairblock.language-bridge {
  margin-top: 26px;
  background: var(--cc-paper);
  border: 1px solid var(--cc-line);
  border-radius: 22px;
  box-shadow: none;
}
.control-panel .language-bridge .pair-row { min-height: 56px; padding: 14px 18px; }
.control-panel .language-bridge .pair-row + .pair-row {
  border-top: 1px solid var(--cc-line);
  margin-left: 18px;
  padding-left: 0;
  padding-right: 18px;
}
.control-panel .language-bridge .pair-row label {
  font-size: 13px;
  color: var(--cc-sub);
  font-weight: 500;
}
.control-panel .language-bridge .custom-select { margin-right: 52px; max-width: 52%; }
.control-panel .language-bridge .custom-select-button {
  color: var(--cc-ink);
  font-size: 16px;
  font-weight: 600;
}
.control-panel .language-bridge .pair-select {
  color: var(--cc-ink);
  margin-right: 52px;
}

/* 骑缝互换钮:Swap 时 180° 旋转 */
.control-panel .language-bridge .swap-langs-button {
  right: 18px;
  width: 44px;
  height: 44px;
  background: var(--cc-paper);
  border: 1px solid var(--cc-line);
  box-shadow: 0 2px 8px rgba(10, 74, 68, 0.1);
  transition: transform 0.45s var(--cc-ease-settle);
}
.control-panel .language-bridge .swap-langs-button svg {
  stroke: var(--cc-teal);
  width: 17px;
  height: 17px;
}
.control-panel .language-bridge .swap-langs-button.is-swapping {
  transform: translateY(-50%) rotate(180deg);
}
.control-panel .language-bridge .swap-langs-button:active {
  transform: translateY(-50%) scale(0.92);
}

/* ---------- Start the call(唯一主行动) ---------- */
/* Fix 2:下部拇指热区簇 —— 语言桥+主按钮+邀请/加入+信任整体顶到下部,页脚沉底 */
.control-panel .action-cluster { margin-top: auto; transform: translateY(5mm); }
.control-panel .action-cluster .language-bridge { margin-top: 0; }
/* 开始通话按键相对语言桥再单独下移 5mm(按钮上方多 5mm 间距) */
.control-panel .call-actions { margin-top: calc(22px + 5mm); }
.control-panel button.primary {
  height: 54px;
  border-radius: 16px;
  background: var(--cc-teal);
  box-shadow: 0 12px 26px -12px rgba(15, 118, 110, 0.55);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.12s var(--cc-ease-soft), background 0.2s ease;
}
.control-panel button.primary:active { transform: scale(0.975); background: var(--cc-deep); }
.control-panel button.primary.is-busy { background: var(--cc-deep); }

/* ---------- Invite someone to talk ---------- */
/* 开始通话按键下方整组(邀请/加入/信任)整体下移 5mm */
.control-panel .entry-panel { margin-top: calc(16px + 5mm); }
.control-panel .entry-share .entry-sect {
  font-size: 12px;
  color: var(--cc-sub);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  padding: 0 4px 8px;
}
.control-panel .invite-field {
  background: var(--cc-paper);
  border: 1px dashed var(--cc-line-strong);
  border-radius: 14px;
  box-shadow: none;
}
.control-panel .invite-field input { color: var(--cc-sub); }
/* Copy:深色实心药丸(对齐 E1 参考稿的深色 Copy 按钮) */
.control-panel .copy-inline {
  background: var(--cc-deep);
  color: #fff;
  flex: 0 0 auto;          /* 明确不伸缩、不被压不撑行 */
  height: 32px;            /* 更小的固定高(原 40) */
  padding: 0 10px;         /* 再收紧(原 14) */
  border-radius: 10px;
  font-size: 13px;         /* 比正文小,整体更紧凑 */
  white-space: nowrap;     /* 标签不换行 */
  transition: background 0.2s ease;
}
.control-panel .copy-inline .icon { display: none; }
.control-panel .copy-inline.is-copied { background: var(--cc-mint); color: var(--cc-deep); }

/* create / join 渐进披露(复用现有 data-entry-mode) */
body[data-entry-mode="join"] .control-panel .create-only { display: none; }
body:not([data-entry-mode="join"]) .control-panel .join-only { display: none; }
body[data-entry-mode="join"] .control-panel .join-switch { display: none; }
body:not([data-entry-mode="join"]) .control-panel .create-switch { display: none; }

/* 安静次级切换链接 */
.control-panel .entry-switch {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 14px;
  padding: 6px 0;
  min-height: 44px;
  /* Fix 4:纯文字链接 —— 去按钮默认外观 + iOS 点按灰闪(灰框来源) */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 13px;
  color: var(--cc-sub);
  cursor: pointer;
}
.control-panel .entry-switch:active,
.control-panel .entry-switch:hover { background: transparent !important; }
.control-panel .entry-switch:focus { outline: none; }
.control-panel .entry-switch:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.4);
  outline-offset: 3px;
  border-radius: 8px;
}
.control-panel .entry-switch b { color: var(--cc-teal); font-weight: 600; }

/* ---------- Trust line ---------- */
.control-panel .trust-line {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: #9AA39F;
}

/* ---------- Footer ---------- */
.control-panel .legal-links {
  margin-top: 24px;
  padding-top: 18px;
  gap: 14px;
}
.control-panel .legal-links a { color: #A7AFAB; font-size: 11.5px; }
.control-panel .legal-links a + a::before { color: #C9CFC9; }

/* ---------- 入口屏深色(D4:保留夜间模式,不崩版) ---------- */
body[data-theme-effective="dark"] .control-panel {
  --cc-sand: #0C1413;
  --cc-paper: #111C1A;
  --cc-ink: #EAF1EF;
  --cc-line: #1E2C29;
  --cc-line-strong: #26342F;
  --cc-sub: #93A09C;
  --cc-teal: #2DD4BF;
  --cc-arc: #F5FBF9;
}
body[data-theme-effective="dark"]:not([data-call-active="true"]) { background: #0C1413; }
body[data-theme-effective="dark"] .control-panel button.primary { color: #05201C; }
/* 深色:白盘转深 */
body[data-theme-effective="dark"] .control-panel .settings-drawer > summary {
  background: #111c1a;
  border-color: #1e2c29;
}
body[data-theme-effective="dark"] .control-panel .trust-line { color: #6C7873; }
body[data-theme-effective="dark"] .control-panel .legal-links a { color: #77827D; }

/* ============================================================
   CES V2 · Call Experience System — Design Tokens (Part 2)
   通话页表现层单一来源。组件只引 token,不写字面量。
   命名空间 --cc-*(与 E1 的 .control-panel 局部 token 不冲突)。
   ============================================================ */
:root {
  /* 2.2 Radius */
  --cc-radius-sm: 10px;
  --cc-radius-md: 16px;
  --cc-radius-lg: 20px;
  --cc-radius-xl: 24px;
  --cc-radius-pill: 999px;
  /* 2.4 Semantic colors (call = dark-first) */
  --cc-surface-call: #0F1413;
  --cc-text-primary: #E7ECEA;
  --cc-text-secondary: #9CA8A3;
  --cc-brand-deep: #0A4A44;
  --cc-brand-teal: #0F766E;
  --cc-accent-mint: #2DD4BF;
  --cc-status-ok: #2DD4BF;
  --cc-status-warn: #E5B567;
  --cc-status-error: #FF6B6B;
  --cc-scrim: rgba(0, 0, 0, 0.72);
  --cc-glass: rgba(20, 26, 25, 0.70);
  --cc-hairline: rgba(255, 255, 255, 0.08);
  --cc-arc-on-dark: #F5FBF9;
  /* 2.5 Elevation / blur / opacity */
  --cc-blur-glass: 20px;
  --cc-blur-pill: 14px;
  --cc-opacity-scrim-top: 0.55;
  --cc-opacity-scrim-bot: 0.72;
  --cc-elev-pip: 0 10px 24px rgba(0, 0, 0, 0.40);
  --cc-elev-bar: 0 8px 30px rgba(0, 0, 0, 0.35);
  /* 2.6 Duration */
  --cc-dur-instant: 120ms;
  --cc-dur-quick: 200ms;
  --cc-dur-standard: 300ms;
  --cc-dur-expressive: 480ms;
  --cc-dur-understand: 900ms;
  --cc-dur-hangup: 1800ms; /* 挂断:停留 ~1s + 慢淡出 ~0.8s */
  --cc-dur-breath: 2800ms;
  --cc-dur-listen: 2400ms;
  --cc-dur-think: 1600ms;
  --cc-dur-connect: 6000ms;
  --cc-dur-speak: 1000ms;
  /* 2.7 Curves (shared names/values with E1) */
  --cc-ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --cc-ease-breath: cubic-bezier(0.65, 0, 0.35, 1);
  --cc-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --cc-ease-linear: linear;
  /* 4.3 timeouts (configurable) */
  --cc-timeout-connect: 20000ms;
  --cc-timeout-think: 8000ms;
  --cc-timeout-reconnect: 30000ms;
}

/* ============================================================
   CES V2 · Motion (Part 6) — approved call-state aperture artwork.
   presence 由 <html data-cc-presence="STATE"> 驱动(FSM · Part 4)
   ============================================================ */
.cc2-aperture { display: block; }
.cc2-aperture .cc2-arc,
.cc2-aperture .cc2-node {
  transform-box: view-box;
  transform-origin: 512px 512px;
}
.cc2-aperture .cc2-arc { stroke: var(--cc-arc-on-dark); }
.cc2-aperture .cc2-node { fill: var(--cc-accent-mint); }

@keyframes cc2-rot { to { transform: rotate(360deg); } }
@keyframes cc2-rot-rev { to { transform: rotate(-360deg); } }
@keyframes cc2-breath { 0%, 100% { transform: scale(1); } 50% { transform: scale(var(--cc2-peak, 1.06)); } }
@keyframes cc2-think-arc { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes cc2-understand-arc { 0% { transform: scale(1.14); } 45% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes cc2-understand-node { 0% { transform: scale(0.6); opacity: 0.5; } 55% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* M-CONNECT (center 120pt, C5) */
[data-cc-presence="CONNECTING"] .cc2-connect-stage .cc2-arc:nth-of-type(1) { animation: cc2-rot var(--cc-dur-connect) var(--cc-ease-linear) infinite; }
[data-cc-presence="CONNECTING"] .cc2-connect-stage .cc2-arc:nth-of-type(2) { animation: cc2-rot-rev var(--cc-dur-connect) var(--cc-ease-linear) infinite; }
[data-cc-presence="RECONNECTING"] .cc2-connect-stage .cc2-arc:nth-of-type(1) { animation: cc2-rot var(--cc-dur-connect) var(--cc-ease-linear) infinite; }
[data-cc-presence="RECONNECTING"] .cc2-connect-stage .cc2-arc:nth-of-type(2) { animation: cc2-rot-rev var(--cc-dur-connect) var(--cc-ease-linear) infinite; }
[data-cc-presence="CONNECTING"] .cc2-connect-stage .cc2-node,
[data-cc-presence="RECONNECTING"] .cc2-connect-stage .cc2-node { animation: cc2-breath var(--cc-dur-breath) var(--cc-ease-breath) infinite; --cc2-peak: 1.07; }

/* inline node (22pt, C4 with State Label) — LISTEN/THINK/UNDERSTAND/SPEAK */
[data-cc-presence="LISTENING"] .cc2-inline .cc2-node { animation: cc2-breath var(--cc-dur-listen) var(--cc-ease-breath) infinite; --cc2-peak: 1.06; }
[data-cc-presence="THINKING"] .cc2-inline .cc2-node { animation: cc2-breath 1200ms var(--cc-ease-breath) infinite; --cc2-peak: 1.08; }
[data-cc-presence="THINKING"] .cc2-inline .cc2-arc { animation: cc2-think-arc var(--cc-dur-think) var(--cc-ease-breath) infinite; }
[data-cc-presence="UNDERSTANDING"] .cc2-inline .cc2-node { animation: cc2-understand-node var(--cc-dur-understand) var(--cc-ease-settle) 1; }
[data-cc-presence="UNDERSTANDING"] .cc2-inline .cc2-arc { animation: cc2-understand-arc var(--cc-dur-understand) var(--cc-ease-settle) 1; }
[data-cc-presence="SPEAKING"] .cc2-inline .cc2-node { animation: cc2-breath var(--cc-dur-speak) var(--cc-ease-breath) infinite; --cc2-peak: 1.16; }
[data-cc-presence="ERROR"] .cc2-inline { opacity: 0.55; }

/* ============================================================
   CES V2 · C5 Connection Stage + C4 inline node + C3 State Label
   ============================================================ */
.cc2-connect-stage {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: calc(34dvh - 60px); /* Part 3.5:120pt 光圈中心对齐屏高 34%(用 dvh,padding-% 是按宽度算的) */
  background: var(--cc-surface-call);
  text-align: center;
  pointer-events: none;
}
.cc2-hangup::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--cc-accent-mint);
  animation: cc2-spinner 900ms linear infinite;
}
body[data-call-active="true"][data-cc-presence="INIT"] .cc2-connect-stage,
body[data-call-active="true"][data-cc-presence="CONNECTING"] .cc2-connect-stage,
body[data-call-active="true"][data-cc-presence="RECONNECTING"] .cc2-connect-stage { display: flex; }
.cc2-connect-stage .cc2-aperture { width: 120px; height: 120px; }
.cc2-connect-stage .cc2-headline {
  margin-top: var(--cc-space-24, 24px);
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
  color: var(--cc-text-primary);
  animation: cc2-fade-in var(--cc-dur-expressive) var(--cc-ease-settle) both;
}
.cc2-connect-stage .cc2-subcopy {
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--cc-text-secondary);
}
/* CES V2 P1 · Item 3 · retry 按钮:仅 E-RECONNECT 显示(平时隐藏、保持自动重连) */
.cc2-error-actions { display: none; margin-top: 24px; pointer-events: auto; }
body[data-cc-error="reconnect"] .cc2-error-actions { display: flex; }
.cc2-retry-btn {
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--cc-radius-md);
  background: var(--cc-brand-teal);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--cc-dur-quick) var(--cc-ease-soft);
}
.cc2-retry-btn:active { background: var(--cc-brand-deep); }
@keyframes cc2-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   CES V2 P1 · Item 4 · M-HANGUP(变体 B:纯淡出,原地,Part 6 600ms)
   动态 additive fixed 叠层(JS 建/自销毁);光圈定位与舞台/连接台一致(34%)。
   pointer-events:none;Reduce Motion 仍保留静态品牌停留约 1s。
   ============================================================ */
.cc2-hangup {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--cc-surface-call);
  pointer-events: none;
}
.cc2-hangup .cc2-aperture {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
}
.cc2-hangup .cc2-arc {
  fill: none;
  stroke: var(--cc-arc-on-dark);
  stroke-width: 92;
  stroke-linecap: round;
}
.cc2-hangup .cc2-node { fill: var(--cc-accent-mint); }
/* 挂断:标志先原地停留 ~1s,再慢慢淡出(0-55% 停留 ≈990ms,55-100% 淡出 ≈810ms) */
@keyframes cc2-hangup-fade { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
.cc2-hangup.playing { animation: cc2-hangup-fade var(--cc-dur-hangup) var(--cc-ease-soft) forwards; }
.cc2-hangup.reduced-motion { opacity: 1; }

/* C3 State Label + C4 inline mini aperture (22pt) */
.cc2-state-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--cc-dur-quick) var(--cc-ease-soft);
}
body[data-call-active="true"][data-cc-presence="LISTENING"] .cc2-state-row,
body[data-call-active="true"][data-cc-presence="THINKING"] .cc2-state-row,
body[data-call-active="true"][data-cc-presence="UNDERSTANDING"] .cc2-state-row,
body[data-call-active="true"][data-cc-presence="SPEAKING"] .cc2-state-row,
body[data-call-active="true"][data-cc-presence="ERROR"] .cc2-state-row { opacity: 1; }
.cc2-state-row .cc2-inline { width: 22px; height: 22px; flex: none; }
.cc2-state-label {
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cc-text-secondary);
}
[data-cc-presence="UNDERSTANDING"] .cc2-state-label,
[data-cc-presence="SPEAKING"] .cc2-state-label { color: var(--cc-accent-mint); }

/* Reduce Motion(Part 7.3):环流全静止,understanding 仅透明度 blip */
@media (prefers-reduced-motion: reduce) {
  .cc2-aperture .cc2-arc,
  .cc2-aperture .cc2-node { animation: none !important; }
  [data-cc-presence="UNDERSTANDING"] .cc2-inline .cc2-node {
    animation: cc2-fade-in 200ms var(--cc-ease-soft) 1 !important;
  }
}

/* app.background:暂停在场动效(decision 7 / E-BG);节点保留、音频不受影响 */
body[data-cc-background="true"] .cc2-aperture .cc2-arc,
body[data-cc-background="true"] .cc2-aperture .cc2-node { animation-play-state: paused; }
/* E-CONNECT / E-RECONNECT:连接台节点变暗(P0 仅状态,依赖自动重连) */
body[data-cc-error] .cc2-connect-stage .cc2-aperture { opacity: 0.55; transition: opacity var(--cc-dur-standard) var(--cc-ease-soft); }
/* 连接/重连态:让连接台干净覆盖,隐藏字幕占位(C5「非黑洞、calm」);连上即恢复 */
body[data-call-active="true"][data-cc-presence="INIT"] .transcript-band,
body[data-call-active="true"][data-cc-presence="CONNECTING"] .transcript-band,
body[data-call-active="true"][data-cc-presence="RECONNECTING"] .transcript-band { opacity: 0; pointer-events: none; }
