/* 页 2 · 团团对话面板（设计 3.4）：外框 thick 玻璃，壳头与输入栏落在玻璃上，对话区、选项、立项卡、菜单都是纸。
   团团的话通栏无气泡，你的话靠右浅底；发送是中性图标；全面板唯一的黄是立项卡的「新建项目草稿」。 */
.tt-pn { position: fixed; z-index: var(--b-z-fab); display: flex; flex-direction: column; padding: 6px; border-radius: var(--b-radius-sheet); }
.tt-pn[hidden] { display: none; }
.tt-pn.glass {
  background: var(--b-glass-bg-thick);
  -webkit-backdrop-filter: blur(var(--b-glass-blur-thick)) saturate(var(--b-glass-saturate));
  backdrop-filter: blur(var(--b-glass-blur-thick)) saturate(var(--b-glass-saturate));
  box-shadow: var(--b-glass-shadow-thick), 0 22px 44px -18px var(--b-glass-caustic);
}
.tt-pn :focus-visible { outline: 2px solid var(--b-focus); outline-offset: 2px; }

/* ── 壳头 ── */
.tt-pn-head { display: flex; align-items: center; gap: var(--b-sp-3); padding: 8px 4px 12px 10px; }
.tt-pn-cat { flex: none; width: var(--b-mascot-panel); height: var(--b-mascot-panel); filter: var(--b-mascot-shadow); }
.tt-pn-id { flex: 1; min-width: 0; }
.tt-pn-idrow { display: flex; align-items: center; gap: var(--b-sp-2); min-width: 0; }
.tt-pn-idrow strong { flex: none; font-size: var(--b-fs-15); font-weight: 600; letter-spacing: var(--b-ls-title); }
.tt-pn-ctx { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 168px; height: 24px; padding: 0 6px 0 9px; border-radius: var(--b-radius-pill); font-size: var(--b-fs-13); font-weight: 500; color: var(--b-text-2); background: var(--b-neutral-tint); transition: background-color var(--m-snappy-t) var(--m-spring-snappy), color var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-ctx:hover, .tt-pn-ctx[aria-expanded="true"] { color: var(--b-text-1); background: var(--b-line-strong); }
.tt-pn-ctx-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-pn-ctx-i { display: inline-flex; flex: none; }
.tt-pn-ctx-i svg { width: 12px; height: 12px; stroke-width: 1.8; }
.tt-pn-status { margin-top: 3px; font-size: var(--b-fs-12); line-height: 1.4; color: var(--b-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-pn-tools { display: flex; flex: none; align-items: center; }
.tt-pn-icon svg { width: 18px; height: 18px; }
.tt-pn-icon[aria-expanded="true"] { color: var(--b-text-1); background: var(--b-neutral-tint); }

/* ── 纸芯 ── */
.tt-pn-paper { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--b-bg-card); box-shadow: inset 0 0 0 1px var(--b-line), 0 1px 2px var(--b-card-shadow); }
.tt-pn-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tt-pn-view[hidden] { display: none; }
.tt-pn-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 18px; scrollbar-width: thin; scrollbar-color: var(--b-line-strong) transparent; }
/* 对话贴着输入栏往上长：内容少时落在纸面下部，不在顶上悬一小段 */
.tt-pn-flow { display: flex; flex-direction: column; justify-content: flex-end; gap: var(--b-sp-4); min-height: 100%; }
/* 往上翻过时，顶边 20px 渐隐，文字不被纸边硬切 */
.tt-pn-flow.is-empty { justify-content: center; }
.tt-pn-scroll.is-scrolled { -webkit-mask-image: linear-gradient(to bottom, transparent, var(--b-text-1) 20px); mask-image: linear-gradient(to bottom, transparent, var(--b-text-1) 20px); }
.tt-pn-list { display: flex; flex-direction: column; gap: var(--b-sp-4); }

/* 对话：团团通栏，你靠右 */
.tt-pn-msg.is-tt { font-size: var(--b-fs-15); line-height: var(--b-lh-body); color: var(--b-text-1); text-wrap: pretty; }
.tt-pn-msg.is-tt p + p, .tt-pn-msg.is-tt ul + p { margin-top: 6px; }
.tt-pn-msg.is-tt ul { margin: 4px 0 2px; }
.tt-pn-msg.is-tt li { position: relative; padding-left: 16px; }
.tt-pn-msg.is-tt li::before { content: ""; position: absolute; left: 3px; top: .8em; width: 5px; height: 1.5px; border-radius: 1px; background: var(--b-text-3); }
.tt-pn-msg.is-you { align-self: flex-end; max-width: 92%; }
.tt-pn-msg.is-you span { display: block; text-wrap: pretty; padding: 8px 14px; border-radius: 16px 16px 6px 16px; font-size: var(--b-fs-15); line-height: 1.6; color: var(--b-text-1); background: var(--b-bg-inset); }
/* 暗色：你的话比纸面亮一档并加发丝边，不和纸面糊成一片 */
html[data-theme="dark"] .tt-pn-msg.is-you span { background: linear-gradient(var(--b-neutral-tint), var(--b-neutral-tint)), var(--b-bg-inset); box-shadow: inset 0 0 0 1px var(--b-line-strong); }
.tt-pn-msg.is-card { padding: 9px 12px 10px; border-radius: 12px; font-size: var(--b-fs-15); line-height: 1.5; color: var(--b-text-1); box-shadow: inset 0 0 0 1px var(--b-line); }
/* 你不在时的事：置顶，每条一行类别小字＋正文；风险用语义危险色写字，不铺底色，黄不做状态 */
.tt-pn-list.is-pins { gap: var(--b-sp-2); }
.tt-pn-pin { padding: 10px 12px 11px; border-radius: 12px; font-size: var(--b-fs-15); line-height: 1.5; color: var(--b-text-1); background: var(--b-bg-inset); }
.tt-pn-pin-k { display: block; margin-bottom: 2px; font-size: var(--b-fs-12); font-weight: 600; letter-spacing: var(--b-ls-cap); color: var(--b-text-3); }
.tt-pn-pin.is-risk .tt-pn-pin-k { color: var(--b-danger); }
.tt-pn-pin.is-delivered .tt-pn-pin-k { color: var(--b-ok); }
.tt-pn-pin.is-focus { box-shadow: inset 0 0 0 1.5px var(--b-text-1); }
.tt-pn-msg.is-tt.is-focus { margin-inline: -10px; padding: 8px 10px; border-radius: 12px; background: var(--b-bg-inset); }

/* 快捷选项：纸、发丝线；推荐项墨色描边＋「推荐」 */
.tt-pn-opts { display: flex; flex-direction: column; align-items: flex-start; gap: var(--b-sp-2); }
.tt-pn-opts:empty { display: none; }
.tt-pn-opt { display: inline-flex; align-items: center; gap: var(--b-sp-2); min-height: 36px; padding: 6px 14px; border-radius: 12px; font-size: var(--b-fs-15); line-height: 1.4; color: var(--b-text-1); background: var(--b-bg-card); box-shadow: inset 0 0 0 1px var(--b-line-strong); text-align: left; transition: background-color var(--m-snappy-t) var(--m-spring-snappy), box-shadow var(--m-snappy-t) var(--m-spring-snappy), scale var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-opt:hover { background: var(--b-bg-inset); }
.tt-pn-opt:active { scale: var(--m-press); }
.tt-pn-opt.is-rec { box-shadow: inset 0 0 0 1.5px var(--b-text-1); }
.tt-pn-opt small { font-size: var(--b-fs-12); font-weight: 500; color: var(--b-text-3); }

/* 立项卡：纸卡，三行理解，一行后果，一黄一文字按钮 */
.tt-pn-offer { padding: 16px 16px 14px; border-radius: 14px; background: var(--b-bg-card); box-shadow: inset 0 0 0 1px var(--b-line-strong), 0 1px 2px var(--b-card-shadow), 0 14px 28px -20px var(--b-card-shadow-far); }
.tt-pn-offer-t { font-size: var(--b-fs-15); font-weight: 600; line-height: 1.45; letter-spacing: var(--b-ls-title); }
.tt-pn-offer-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--b-sp-3); margin: 12px 0 0; padding-top: 12px; box-shadow: inset 0 1px 0 var(--b-line); }
.tt-pn-offer-dl dt { font-size: var(--b-fs-13); line-height: 1.6; color: var(--b-text-3); }
.tt-pn-offer-dl dd { font-size: var(--b-fs-15); line-height: 1.5; color: var(--b-text-1); }
.tt-pn-offer-note { margin-top: 14px; font-size: var(--b-fs-12); line-height: 1.5; color: var(--b-text-3); }
.tt-pn-offer-acts { display: flex; align-items: center; gap: var(--b-sp-1); margin-top: var(--b-sp-2); }
.tt-pn-quiet { color: var(--b-text-2); background: transparent; }
.tt-pn-quiet:hover { color: var(--b-text-1); background: var(--b-neutral-tint); }
.tt-pn-offer-line { display: flex; align-items: center; gap: var(--b-sp-3); font-size: var(--b-fs-12); color: var(--b-text-3); }
.tt-pn-offer-line::before, .tt-pn-offer-line::after { content: ""; flex: 1; height: 1px; background: var(--b-line); }

.tt-pn-converted { display: flex; align-items: center; justify-content: space-between; gap: var(--b-sp-3); width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; font-size: var(--b-fs-15); font-weight: 500; text-align: left; color: var(--b-text-1); background: var(--b-bg-card); box-shadow: inset 0 0 0 1px var(--b-line-strong); transition: background-color var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-converted:hover { background: var(--b-bg-inset); }
.tt-pn-converted span:last-child { color: var(--b-text-3); }

/* 空会话 */
.tt-pn-hello p { font-size: var(--b-fs-15); line-height: var(--b-lh-body); color: var(--b-text-2); }
.tt-pn-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: var(--b-sp-3); padding: 10px 14px; border-radius: 12px; font-size: var(--b-fs-13); line-height: 1.5; text-align: left; color: var(--b-text-1); background: var(--b-bg-inset); transition: box-shadow var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-suggest:hover { box-shadow: inset 0 0 0 1px var(--b-line-strong); }
.tt-pn-suggest small { font-size: var(--b-fs-12); color: var(--b-text-3); }

/* ── 输入栏（玻璃上的一条纸） ── */
.tt-pn-composer { display: flex; align-items: flex-end; gap: var(--b-sp-1); margin-top: 6px; padding: 5px 5px 5px 14px; border-radius: 16px; background: var(--b-bg-card); box-shadow: inset 0 0 0 1px var(--b-line); transition: box-shadow var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-composer:focus-within { box-shadow: inset 0 0 0 1px var(--b-line-strong), 0 0 0 3px var(--b-neutral-tint); }
.tt-pn-composer[hidden], .tt-pn-foot[hidden] { display: none; }
.tt-pn-input { flex: 1; min-width: 0; height: 108px; min-height: 88px; max-height: min(280px, 35dvh); padding: 5px 0; border: 0; resize: vertical; outline: none; background: transparent; font-size: var(--b-fs-15); line-height: 22px; color: var(--b-text-1); }
.tt-pn-input::placeholder { color: var(--b-text-3); }
.tt-pn .tt-pn-input:focus-visible, .tt-pn .tt-pn-search-in:focus-visible { outline: none; box-shadow: none; }
.tt-pn-send { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--b-radius-pill); color: var(--b-text-1); background: var(--b-neutral-tint); transition: background-color var(--m-snappy-t) var(--m-spring-snappy), color var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-send svg { width: 18px; height: 18px; stroke-width: 1.9; }
.tt-pn-send:not(:disabled):hover { background: var(--b-line-strong); }
.tt-pn-send:disabled { color: var(--b-text-disabled); background: transparent; cursor: default; }

.tt-pn-foot { display: flex; align-items: center; justify-content: center; gap: var(--b-sp-2); min-height: 44px; margin-top: 6px; font-size: var(--b-fs-13); color: var(--b-text-2); }
.tt-pn-goto { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 44px; border-radius: 16px; font-size: var(--b-fs-15); font-weight: 500; color: var(--b-text-1); background: var(--b-bg-card); box-shadow: inset 0 0 0 1px var(--b-line); transition: box-shadow var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-goto:hover { box-shadow: inset 0 0 0 1px var(--b-line-strong); }
.tt-pn-goto.is-inline { width: auto; height: auto; padding: 0; font-size: var(--b-fs-13); font-weight: 600; background: none; box-shadow: none; }
.tt-pn-goto.is-inline:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── 菜单（纸） ── */
.tt-pn-menu { position: absolute; z-index: 5; top: 62px; min-width: 208px; padding: 6px; border-radius: 14px; background: var(--b-bg-card); box-shadow: inset 0 0 0 1px var(--b-line), var(--b-glass-shadow-thick); }
.tt-pn-menu.is-ctx { left: 62px; }
.tt-pn-menu.is-more { right: 42px; }
.tt-pn-ml { padding: 6px 10px 2px; font-size: var(--b-fs-12); font-weight: 600; letter-spacing: var(--b-ls-cap); color: var(--b-text-3); }
.tt-pn-mnote { padding: 0 10px 6px; font-size: var(--b-fs-12); color: var(--b-text-3); }
.tt-pn-mi { display: flex; align-items: center; gap: var(--b-sp-2); width: 100%; height: 36px; padding: 0 10px; border-radius: 10px; font-size: var(--b-fs-15); color: var(--b-text-1); text-align: left; }
.tt-pn-mi:hover, .tt-pn-mi:focus-visible { background: var(--b-bg-inset); outline: none; }
.tt-pn-mi-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-pn-mi small { flex: none; font-size: var(--b-fs-12); color: var(--b-text-3); }
.tt-pn-mi-c { display: inline-flex; flex: none; width: 16px; margin-left: auto; }
.tt-pn-mi-c svg { width: 16px; height: 16px; stroke-width: 1.8; }
.tt-pn-mhr { height: 1px; margin: 4px 6px; border: 0; background: var(--b-line); }

/* ── 项目上下文 ── */
.tt-pn-proj { overflow-y: auto; gap: var(--b-sp-3); padding: 20px; }
.tt-pn-phead h3 { margin-top: 4px; font-size: var(--b-fs-20); font-weight: 700; line-height: var(--b-lh-title); letter-spacing: var(--b-ls-title); }
.tt-pn-pk { font-size: var(--b-fs-12); font-weight: 600; letter-spacing: var(--b-ls-cap); color: var(--b-text-3); }
.tt-pn-pk.is-sub { margin-top: var(--b-sp-3); padding-top: var(--b-sp-4); box-shadow: inset 0 1px 0 var(--b-line); }
.tt-pn-pmeta { margin-top: 4px; font-size: var(--b-fs-13); color: var(--b-text-2); }
.tt-pn-pempty { padding: 4px 0; font-size: var(--b-fs-13); color: var(--b-text-3); }

/* ── 历史 ── */
.tt-pn-history { padding: 10px 10px 0; }
.tt-pn-hhead { display: flex; align-items: center; gap: var(--b-sp-1); height: 36px; }
.tt-pn-hhead strong { font-size: var(--b-fs-15); font-weight: 600; }
.tt-pn-search { display: flex; align-items: center; gap: var(--b-sp-2); height: 36px; margin: 6px 2px 4px; padding: 0 12px; border-radius: 10px; color: var(--b-text-3); background: var(--b-bg-input); box-shadow: inset 0 0 0 1px var(--b-line); }
.tt-pn-search:focus-within { box-shadow: inset 0 0 0 1px var(--b-line-strong), 0 0 0 3px var(--b-neutral-tint); }
.tt-pn-search > span { display: inline-flex; }
.tt-pn-search svg { width: 16px; height: 16px; }
.tt-pn-search-in { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: var(--b-fs-13); color: var(--b-text-1); }
.tt-pn-search-in::placeholder { color: var(--b-text-3); }
.tt-pn-hgroup:first-child h4 { padding-top: 8px; }
.tt-pn-hlist { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 12px; scrollbar-width: thin; }
.tt-pn-hgroup h4 { padding: 14px 10px 4px; font-size: var(--b-fs-12); font-weight: 600; letter-spacing: var(--b-ls-cap); color: var(--b-text-3); }
.tt-pn-hrow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--b-sp-2); padding: 9px 10px; border-radius: 12px; transition: background-color var(--m-snappy-t) var(--m-spring-snappy); }
.tt-pn-hrow:hover, .tt-pn-hrow:focus-within, .tt-pn-hrow.is-cur { background: var(--b-bg-inset); }
.tt-pn-hmain { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; text-align: left; }
.tt-pn-hmain:focus-visible { outline: none; }
.tt-pn-htitle, .tt-pn-hlast { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-pn-htitle { font-size: var(--b-fs-15); font-weight: 500; color: var(--b-text-1); }
.tt-pn-hlast { font-size: var(--b-fs-13); color: var(--b-text-3); }
.tt-pn-htag { margin-top: 6px; padding: 0 7px; border-radius: 6px; font-size: var(--b-fs-12); font-weight: 600; line-height: 20px; color: var(--b-text-2); background: var(--b-neutral-tint); }
.tt-pn-htime { padding-top: 3px; font-size: var(--b-fs-12); font-variant-numeric: tabular-nums; color: var(--b-text-3); }
.tt-pn-hacts { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--b-bg-inset); opacity: 0; pointer-events: none; transition: opacity var(--m-fast) linear; }
.tt-pn-hacts .link-btn { height: 26px; padding: 0 8px; border-radius: 6px; }
.tt-pn-hacts .link-btn:hover { background: var(--b-neutral-tint); }
.tt-pn-hacts .link-btn.is-danger { color: var(--b-danger); font-weight: 600; }
.tt-pn-hrow:hover .tt-pn-hacts, .tt-pn-hrow:focus-within .tt-pn-hacts, .tt-pn-hacts.is-on { opacity: 1; pointer-events: auto; }
.tt-pn-hrow:hover .tt-pn-htime, .tt-pn-hrow:focus-within .tt-pn-htime { visibility: hidden; }
.tt-pn-hrow.is-edit { align-items: center; background: var(--b-bg-inset); }
.tt-pn-hrow.is-edit .tt-pn-hacts { position: static; background: none; }
.tt-pn-rename { width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; outline: none; font-size: var(--b-fs-15); color: var(--b-text-1); background: var(--b-bg-card); box-shadow: inset 0 0 0 1.5px var(--b-focus); }
.tt-pn .tt-pn-rename:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--b-focus); }
.tt-pn-hask { font-size: var(--b-fs-15); color: var(--b-text-1); }

@media (prefers-reduced-transparency: reduce) {
  .tt-pn.glass { background: var(--b-glass-frost); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
