/* 站內聊天提示(spec designer chat-notify-2026-11-26):把手與手機頂列聊天 icon 的點、房名列的鈴鐺、
   「提示哪些訊息」選單(鈴鐺與帳戶設定 › 通知共用)。兩個 Studio base(common/chat_cue.html)與設定頁載入。
   區域筆記 docs/notes/chat-cue.md */

/* ---- Attention dot (canon › Attention dot):6px、有事才渲染(chat_cue.js 建／拿掉)、aria-hidden;
   灰 = 聊天室與站方動態(中性點),紅 = 客服回覆了。外圍 2px 地色缺口用 outline,不用陰影 ---- */
.cue_dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--ink-2);
  outline: 2px solid var(--bg-body);
  pointer-events: none;
}

.cue_dot.red {
  background: var(--color-red);
}

/* 右欄把手(推開版 #dk_toggle、抽屜版 #dk_open_m 同一顆):錨在把手本身右上 −2 */
.dk-handle .cue_dot {
  top: -2px;
  right: -2px;
}

/* ≤768 頂列的聊天 icon:20 的 icon 置中在 44 的框裡(site_search.css),點錨在 icon 的右上 −2(框中心 ± 10 + 2) */
header .nav_chat_m .cue_dot {
  top: calc(50% - 12px);
  right: calc(50% - 12px);
}

/* ---- 鈴鐺:28 的 icon 鈕,熱區用 ::before 補到 44 ---- */
.cue_wrap {
  position: relative;
  flex: none;
}

.cue_wrap[hidden] {
  display: none;
}

.cue_bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--ink-2);
  transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.cue_bell::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--space-8));
}

.cue_bell[aria-expanded="true"] {
  background: var(--surface-muted);
  color: var(--ink);
}

@media (hover: hover) {
  .cue_bell:hover {
    background: var(--surface-muted);
    color: var(--ink);
  }
}

.cue_bell .ico {
  width: 18px;
  height: 18px;
}

/* 聊天頁的房名列:靠右(≤1300 也是房內的標題列) */
#chat_page .chat_rh > .cue_wrap {
  margin-left: auto;
}

/* 右欄頭部的 icon 鈕(標到聊天室、鈴鐺、抽屜的 ✕)兩兩之間多 8:頭部的 gap 8 加這 8 = 16,中心距 44,
   每顆 44 的熱區彼此不重疊。gap 不動(它也管 ‹ 與房名) */
#chat_dock .dk-place:not([hidden]) + .cue_wrap:not([hidden]),
#chat_dock .cue_wrap:not([hidden]) + .dk-x,
#chat_dock .dk-place:not([hidden]) + .cue_wrap[hidden] + .dk-x {
  margin-left: var(--space-8);
}

/* 右欄:房間畫面才有,列表畫面不放 */
#chat_dock.dk-on-list .cue_wrap {
  display: none;
}

/* 手機寬不放鈴鐺(chat_cue.js 也不顯示;這條守住跨寬度的那一刻) */
@media (max-width: 768px) {
  .cue_wrap[data-cue-bell] {
    display: none;
  }
}

/* ---- 選單 (canon › Dropdown menu:Panel,Terminal 列距;目前那列 Selected = 加粗＋aria-current) ---- */
.cue_pop {
  position: absolute;
  top: calc(100% + var(--space-8));
  right: 0;
  z-index: 20;
  width: 232px;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
  text-align: left;
}

.cue_pop[hidden] {
  display: none;
}

.cue_pop [role="menu"] button {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: var(--space-6) 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
}

.cue_pop [role="menu"] button[aria-current="true"] {
  font-weight: 600;
}

@media (hover: hover) {
  .cue_pop [role="menu"] button:hover {
    background: var(--surface-muted);
    color: var(--ink);
  }
}

@media (pointer: coarse) {
  .cue_pop [role="menu"] button {
    min-height: 44px;
  }
}

/* 設定頁(Editorial)的選單列:canon › Dropdown menu › Items 的 Editorial metrics;右欄與聊天頁維持 Terminal */
.nc .cue_pop [role="menu"] button {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* 封鎖時三列下面那一行 12px --ink-3,〔怎麼重新開〕原地展開一句步驟(沿用工作頁)。
   聊天頁與右欄的 p 歸零規則是 ID 級(chat/main.css),這裡跟著帶一份同級的 */
.cue_pop .cue_blk,
:is(#chat_page, #chat_dock_root) .cue_pop .cue_blk {
  margin: 0;
  padding: var(--space-4) 10px var(--space-6);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}

.cue_blk[hidden] {
  display: none;
}

.cue_how {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link-quiet);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cue_how::before {
  content: "";
  position: absolute;
  /* 12px 字、行高 18:上下各 13 補到 44 */
  inset: -13px calc(-1 * var(--space-4));
}

/* ---- 帳戶設定 › 通知 › 聊天:Select 觸發鈕(canon › Input › Select 觸發鈕:Input 外形 44、radius md),
   點了開同一份選單,選單左緣對齊它、右邊放不下才夾回視窗(chat_cue_pref.js menu() 的 alignLeft) ---- */
.cue_set {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--space-32) 0 var(--space-12);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-md);
  background: var(--surface-field) var(--select-chevron) no-repeat calc(100% - var(--space-8)) center / 20px;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color var(--motion-fast) var(--ease-standard);
}

.cue_set[aria-expanded="true"] {
  background-color: var(--surface-muted);
}

@media (hover: hover) {
  .cue_set:hover {
    background-color: var(--surface-muted);
  }
}

.nc_head .cue_wrap .cue_pop {
  right: auto;
  left: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cue_bell,
  .cue_set {
    transition: none;
  }
}
