  :root{
    --font-readable:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif;
    --screen-height: 100vh;
    --keyboard-offset: 0px;
    --ios-pwa-bottom-bleed: 0px;
    --ref-width: 941px;
    --ref-height: 1672px;
    --font-en: "Cormorant Garamond", Georgia, serif;
    --font-cn: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --wall-light: url("chat-light.webp");
    --wall-harbor: url("chat-harbor.webp");
    --wall-default: var(--wall-light);
    --menu-wall-light: url("menu-light.webp");
    --menu-wall-harbor: url("menu-harbor.webp");
    --menu-wall-default: var(--menu-wall-light);
    --avatar-default: url("avatar-codex-bunny.jpg");
    /* ── PEARL TIDE · 珍珠潮汐(default) ── */
    --bg: #F7FAFC;
    --header-bg: #F7FAFC;
    --hairline: rgba(120,142,165,.24);
    --text: #253447;
    --text-soft: #5E7080;
    --text-faint: #8A99A8;
    --bubble-ai-bg: #ECEEF3;
    --bubble-ai-fg: #253447;
    --bubble-ai-line: transparent;
    --bubble-human-bg: #DFE5EE;
    --bubble-human-fg: #253447;
    --bubble-human-line: transparent;
    --accent: #4C6378;
    --send-bg: #2C4056;
    --tick: #7E93A4;
    --accent-fg: #ffffff;
    --think-flourish: rgba(99, 121, 142, 0.52);
    --think-label: #6A7E8E;
    --think-body: #56697A;
    --composer-bg: #EEF4FA;
    --field-bg: rgba(247,250,252,.92);
    --field-line: rgba(151,169,181,.18);
    --shadow: 0 18px 46px rgba(74, 93, 108, 0.10);
    --soft-shadow: 0 14px 34px rgba(86, 104, 118, 0.08);
    --scrim: linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0.12) 30%, rgba(255,255,255,0.04) 68%, rgba(255,255,255,0.22));
    --header-h: clamp(56px, 10vw, 120px);
    --side-pad: clamp(16px, 4vw, 40px);
    --avatar-size: clamp(32px, 5vw, 48px);
    --bubble-radius: clamp(14px, 2vw, 20px);
    --composer-h: clamp(44px, 6vw, 72px);
    --motion-fast: 150ms;
    --motion-normal: 260ms;
    --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
    /* composer 占据的底部区域(含安全区/键盘):scroll 底 padding 与边缘渐隐共用同一来源,保持对齐 */
    --composer-zone: calc(var(--composer-h) + 16px + env(safe-area-inset-bottom) + var(--keyboard-offset));
    --edge-fade-top: clamp(24px, 5vw, 52px);
    --edge-fade-tail: clamp(16px, 3vw, 30px);
    /* profile / settings — frosted glass, blends into the wallpaper */
    --card-bg: rgba(244,248,250,.42);
    --card-line: rgba(150,168,182,.12);
    --card-shadow: 0 10px 28px rgba(70,92,108,.05);
    --seg-track: rgba(140,160,176,.11);
    --seg-thumb: rgba(255,255,255,.68);
    --seg-thumb-shadow: 0 2px 8px rgba(40,60,78,.08);
    --row-press: rgba(140,160,176,.09);
    --slider-track: rgba(143,162,176,.28);
    --slider-thumb: #44627b;
    --info-ring: rgba(143,162,176,.38);
    --status-dot: #5fbf8f;
  }
  /* ── HARBOR · 海港(通用开源主题 / 上游 Tidal_Echo) ── 中性冷调,供 fork 使用;只覆盖带色相变量,其余继承 PEARL TIDE */
  :root[data-theme="harbor"]{
      --wall-default: var(--wall-harbor);
      --menu-wall-default: var(--menu-wall-harbor);
      --bg: #F4F2EF;
      --header-bg: #F4F2EF;
      --hairline: rgba(74,93,108,.20);
      --text: #36404B;
      --text-soft: #5E6B78;
      --text-faint: #9197A0;
      --bubble-ai-bg: #EAE6E4;
      --bubble-ai-fg: #36404B;
      --bubble-human-bg: #E1E0E3;
      --bubble-human-fg: #36404B;
      --accent: #4A5D6C;
      --send-bg: #4A5D6C;
      --tick: #7E8E9C;
      --accent-fg: #ffffff;
      --think-flourish: rgba(74, 93, 108, 0.48);
      --think-label: #5E6B78;
      --think-body: #4F5D6A;
      --composer-bg: #EFEBE8;
      --field-bg: rgba(244,242,239,.92);
      --slider-thumb: #4A5D6C;
      --status-dot: #6FA98C;
  }

  *{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body{ margin:0; padding:0; height:100%; overflow:hidden; overscroll-behavior:none; }
  body{ position: fixed; inset: 0; width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-cn);
    font-size: clamp(14px, 1.45vw, 16px);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior: none;
  }

  .app{
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    width: min(100vw, var(--ref-width));
    margin: 0 auto;
    overflow: hidden;
  }
  .wall{
    position:fixed;
    inset:0;
    width:100vw;
    height:var(--screen-height);
    z-index:0;
    background-color: var(--bg);
    background-image: var(--wall-default);
    background-size: cover; background-position: center;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  .wall::after{
    content:""; position:absolute; inset:0; background: var(--scrim); pointer-events:none;
  }
  .topbar, .agent-strip, .scroll, .composer{ position: relative; z-index: 1; }

  /* ── Header (floating frosted pill + corner avatar) ── */
  .topbar{
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    height: calc(var(--header-h) + env(safe-area-inset-top));
    padding: calc(env(safe-area-inset-top) + 8px) var(--side-pad) 10px;
    border-bottom: 1px solid var(--hairline);
    pointer-events: none;
  }
  .topbar > *{ pointer-events: auto; }
  .peerpill{
    display:flex; flex-direction:column; align-items:center; line-height:1.15;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 76px;
  }
  .peerpill .name{
    font-family: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0;
    text-shadow: 0 1px 18px rgba(255,255,255,0.3);
  }
  .peerpill .status{
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(12px, 1.8vw, 16px);
    color: var(--text-soft);
    margin-top: 4px;
    letter-spacing: 0;
  }
  .app[data-conn="reconnecting"] .peerpill .status{ color:#9a8061; }
  .peerpill .status.typing{
    color: #4f9fda;
    font-weight: 500;
    text-shadow: 0 0 16px rgba(79,159,218,.24);
    display: inline-flex; align-items: center;
  }
  .typing-dots{ display:inline-flex; align-items:center; gap:3px; margin-left:6px; }
  .typing-dots i{ width:4px; height:4px; border-radius:50%; background:currentColor; animation: typingDot 1.25s ease-in-out infinite; }
  .typing-dots i:nth-child(2){ animation-delay:.16s; }
  .typing-dots i:nth-child(3){ animation-delay:.32s; }
  @keyframes typingDot{ 0%,70%,100%{ transform:translateY(0); opacity:.4; } 35%{ transform:translateY(-3px); opacity:1; } }
  .backbtn{
    position:absolute; left: calc(var(--side-pad) + 4px); top: calc(env(safe-area-inset-top) + clamp(14px, 2.5vw, 36px));
    width:36px; height:36px; border-radius:50%; padding:0; flex:none; cursor:pointer;
    border: none; background: transparent;
    color: var(--text); display:grid; place-items:center;
    transition: transform .15s ease;
  }
  .backbtn:active{ transform: scale(.9); }
  .backbtn svg{ width:22px; height:22px; display:block; margin-left:-2px; }
  .header-actions{
    position:absolute;
    right: calc(var(--side-pad) - 2px);
    top: calc(env(safe-area-inset-top) + clamp(14px, 2.5vw, 36px));
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap: clamp(24px, 4vw, 42px);
    height:36px;
  }
  .topbtn{
    width:36px;
    height:36px;
    border:0;
    border-radius:50%;
    padding:0;
    background:transparent;
    color: var(--text);
    display:grid;
    place-items:center;
    cursor:pointer;
    transition: transform .15s ease;
  }
  .topbtn:active{ transform: scale(.9); }
  .topbtn svg{ width:24px; height:24px; display:block; }
  .topbtn.more svg{ width:22px; height:22px; }
  .topbtn.terminal.active{ color:var(--accent); }
  .agent-strip{
    flex:0 0 auto;
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding:8px var(--side-pad) 10px;
    scrollbar-width:none;
    border-bottom:1px solid var(--hairline);
    -webkit-overflow-scrolling:touch;
  }
  .agent-strip::-webkit-scrollbar{ display:none; }
  .agent-chip{
    flex:0 0 auto;
    min-width:132px;
    display:grid;
    grid-template-columns:38px 1fr;
    gap:9px;
    align-items:center;
    padding:7px 11px 7px 8px;
    border:1px solid var(--card-line);
    border-radius:16px;
    background:var(--card-bg);
    box-shadow:var(--card-shadow);
    -webkit-backdrop-filter:blur(14px);
    backdrop-filter:blur(14px);
  }
  .agent-chip-avatar{
    position:relative;
    width:38px;
    height:38px;
    border-radius:50%;
    background-size:cover;
    background-position:center;
    box-shadow:0 5px 12px rgba(45,62,78,.14);
  }
  .agent-chip-dot{
    position:absolute;
    right:-1px;
    bottom:0;
    width:9px;
    height:9px;
    border:2px solid rgba(255,255,255,.9);
    border-radius:50%;
    background:#aab3bb;
  }
  .agent-chip.online .agent-chip-dot{ background:#55b985; }
  .agent-chip.typing .agent-chip-dot{ background:#5a9fdb; animation:typingDot 1.1s ease-in-out infinite; }
  .agent-chip-copy{ min-width:0; display:flex; flex-direction:column; line-height:1.25; }
  .agent-chip-name{ font-size:12.5px; color:var(--text); font-weight:600; }
  .agent-chip-model{ max-width:126px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10.5px; color:var(--text-faint); }
  .session-pop{
    position:absolute;
    right: calc(var(--side-pad) + 34px);
    top: calc(env(safe-area-inset-top) + clamp(58px, 8vw, 82px));
    z-index:30;
    width:min(82vw, 320px);
    max-height:min(58vh, 480px);
    overflow:auto;
    padding:10px;
    border-radius:18px;
    background:var(--panel-bg);
    border:1px solid var(--card-line);
    box-shadow:0 18px 50px rgba(30,45,62,.18);
    -webkit-backdrop-filter:blur(18px);
    backdrop-filter:blur(18px);
  }
  .session-pop[hidden]{ display:none !important; }
  .session-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 2px 8px; }
  .session-title{ font-size:12px; color:var(--text-faint); font-family:var(--font-en), var(--font-cn); }
  .session-new{
    border:1px solid var(--seg-line); border-radius:999px; padding:5px 9px;
    background:var(--seg-track); color:var(--text-soft); font:inherit; font-size:11.5px; cursor:pointer;
  }
  .session-new:disabled{ opacity:.5; cursor:default; }
  .session-list{ display:flex; flex-direction:column; gap:2px; }
  .session-item{
    border:0; width:100%; background:transparent; color:var(--text);
    display:grid; grid-template-columns:1fr auto; align-items:center; gap:8px;
    padding:10px 9px; border-radius:12px; text-align:left; cursor:pointer; font:inherit;
  }
  .session-item.active{ background:var(--seg-track); }
  .session-item:active{ transform:scale(.992); }
  .session-main{ min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:3px; }
  .session-name{ font-size:14px; line-height:1.25; }
  .session-active-dot{ display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:var(--status-dot); vertical-align:1px; box-shadow:0 0 0 3px color-mix(in srgb, var(--status-dot) 14%, transparent); }
  .session-meta{ font-size:11px; color:var(--text-faint); font-family:var(--font-en), var(--font-cn); }
  .session-rename{
    border:0; background:transparent; color:var(--text-faint); width:28px; height:28px;
    border-radius:50%; display:grid; place-items:center; cursor:pointer; padding:0;
  }
  .session-rename:hover{ color:var(--accent); background:var(--seg-track); }
  .session-rename svg{ width:15px; height:15px; display:block; }
  .terminal-panel{
    position:fixed;
    inset:0;
    z-index:260;
    display:flex;
    flex-direction:column;
    background:#050607;
    color:#d7f7df;
    font-family:"SFMono-Regular", Consolas, "Cascadia Mono", monospace;
    transform:translateX(100%);
    transition:transform .24s cubic-bezier(.2,.8,.2,1);
  }
  .terminal-panel.open{ transform:translateX(0); }
  .terminal-top{
    flex:none;
    min-height:calc(52px + env(safe-area-inset-top));
    display:flex;
    align-items:center;
    gap:10px;
    padding:calc(env(safe-area-inset-top) + 8px) 12px 8px;
    border-bottom:1px solid rgba(157,255,188,.18);
    background:#080a0b;
  }
  .terminal-back{
    flex:none;
    width:34px;
    height:34px;
    border:0;
    border-radius:50%;
    background:transparent;
    color:#d7f7df;
    display:grid;
    place-items:center;
    padding:0;
    cursor:pointer;
  }
  .terminal-back:active{ transform:scale(.9); }
  .terminal-back svg{ width:21px; height:21px; display:block; }
  .terminal-title{ min-width:0; display:flex; flex-direction:column; gap:2px; line-height:1.15; }
  .terminal-title strong{ font-size:14px; font-weight:600; color:#effff4; }
  .terminal-title span{
    font-size:11px;
    color:rgba(215,247,223,.62);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .terminal-log{
    flex:1 1 auto;
    overflow:auto;
    padding:14px 14px 18px;
    font-size:13px;
    line-height:1.55;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
  }
  .term-entry{ margin:0 0 13px; }
  .term-user{ color:#9dffbc; }
  .term-assistant{ color:#d7f7df; }
  .term-tool{
    color:#b6d6ff;
    border-left:2px solid rgba(126,174,255,.45);
    padding-left:10px;
  }
  .term-muted{ color:rgba(215,247,223,.48); }
  .term-cmd{ color:#9dffbc; }
  .term-err{ color:#ffb0a3; }
  .terminal-form{
    flex:none;
    display:flex;
    align-items:flex-end;
    gap:9px;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top:1px solid rgba(157,255,188,.18);
    background:#080a0b;
  }
  .terminal-prompt{ flex:none; color:#9dffbc; font-size:15px; line-height:34px; }
  .terminal-input{
    flex:1 1 auto;
    min-width:0;
    max-height:120px;
    border:0;
    outline:0;
    resize:none;
    background:transparent;
    color:#effff4;
    font:inherit;
    font-size:15px;
    line-height:1.45;
    padding:6px 0;
  }
  .terminal-input::placeholder{ color:rgba(215,247,223,.34); }
  .terminal-send{
    flex:none;
    width:34px;
    height:34px;
    border:1px solid rgba(157,255,188,.34);
    border-radius:50%;
    background:rgba(157,255,188,.1);
    color:#d7f7df;
    display:grid;
    place-items:center;
    padding:0;
    cursor:pointer;
  }
  .terminal-send:active{ transform:scale(.92); }
  .terminal-send svg{ width:18px; height:18px; display:block; }
  .avatar{
    position:absolute; right: calc(var(--side-pad) - 3px); top: calc(env(safe-area-inset-top) + clamp(14px, 2.5vw, 36px));
    width: var(--avatar-size); height: var(--avatar-size); border-radius:50%; padding:0; flex:none; cursor:pointer;
    border: none;
    background-image: var(--avatar-default);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(24,46,67,0.16);
  }
  .avatar:focus-visible,
  .backbtn:focus-visible,
  button:focus-visible,
  textarea:focus-visible,
  input:focus-visible{
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  /* ── Messages ── */
  .scroll{
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overflow-anchor: none;
    padding: clamp(14px, 2.4vw, 28px) var(--side-pad) var(--composer-zone);
    display: flex; flex-direction: column;
    transition: padding-bottom .28s cubic-bezier(.2,.8,.2,1);
    /* 边缘渐隐:顶部一段、底部对齐 composer 上沿一段,消息滚到边缘自然淡出 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--edge-fade-top), #000 calc(100% - var(--composer-zone)), transparent calc(100% - var(--composer-zone) + var(--edge-fade-tail)));
    mask-image: linear-gradient(to bottom, transparent 0, #000 var(--edge-fade-top), #000 calc(100% - var(--composer-zone)), transparent calc(100% - var(--composer-zone) + var(--edge-fade-tail)));
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  }
  .scroll::-webkit-scrollbar{ width:0; height:0; }
  .v-spacer{
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    pointer-events: none;
  }

  .day{
    align-self: center;
    margin: 0;
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(12px, 1.6vw, 16px); color: var(--text-faint);
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
  }

  .row{ display:flex; position:relative; margin-top: clamp(14px, 2.2vw, 28px); }
  .day + .row{ margin-top: clamp(12px, 1.8vw, 20px); }
  .new-divider{
    display:flex;
    align-items:center;
    justify-content:center;
    gap: clamp(16px, 2.4vw, 24px);
    margin: clamp(16px, 2.4vw, 28px) 0 clamp(12px, 1.8vw, 20px);
    color: var(--text-faint);
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(12px, 1.6vw, 16px);
    line-height:1;
    letter-spacing:0;
  }
  .new-divider::before,
  .new-divider::after{
    content:"";
    width: clamp(94px, 24vw, 226px);
    height:1px;
    background: var(--hairline);
  }
  .row.grouped{ margin-top: clamp(4px, 0.8vw, 8px); }
  .row.human{ justify-content: flex-end; }
  .row.ai{ justify-content: flex-start; padding-left: calc(var(--avatar-size) + clamp(10px, 1.6vw, 16px)); }
  .row.ai::before{
    content:"";
    position:absolute;
    left:0;
    top: clamp(5px, 1vw, 9px);
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    background-image: var(--avatar-default);
    background-size: cover;
    background-position: center;
    box-shadow: 0 12px 24px rgba(24,46,67,0.14);
  }

  .bubble{
    max-width: min(61vw, 506px);
    padding: clamp(8px, 1.05vw, 12px) clamp(13px, 1.65vw, 18px) clamp(8px, 1.1vw, 13px);
    border-radius: var(--bubble-radius);
    position: relative;
    font-family: var(--font-cn);
    font-size: clamp(14px, 1.55vw, 16px); line-height: 1.58;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: pop .24s cubic-bezier(.2,.8,.2,1) both;
  }
  .row[data-vkey] .bubble,
  .row[data-vkey] .think-block{ animation: none; }
  @keyframes pop{ from{ transform: translateY(5px) scale(.99);} to{ transform:none;} }
  /* 新消息入场:轻微弹性,只对刚发/刚收到那条播一次(虚拟列表复用不重播,JS 控 enter class) */
  .row[data-vkey].enter-human .bubble{ transform-origin: bottom right; animation: enterHuman .44s cubic-bezier(.34,1.46,.5,1) both; }
  .row[data-vkey].enter-ai .bubble{ transform-origin: bottom left; animation: enterAi .44s cubic-bezier(.34,1.46,.5,1) both; }
  @keyframes enterHuman{ from{ transform: translate(6px, 9px) scale(.95); opacity:0; } 55%{ opacity:1; } to{ transform:none; opacity:1; } }
  @keyframes enterAi{ from{ transform: translate(-6px, 9px) scale(.95); opacity:0; } 55%{ opacity:1; } to{ transform:none; opacity:1; } }
  .row.ai .bubble{
    background: var(--bubble-ai-bg);
    color: var(--bubble-ai-fg);
    border: 0;
    box-shadow: 0 10px 28px rgba(78, 94, 108, 0.08);
  }
  .row.human .bubble{
    background: var(--bubble-human-bg);
    color: var(--bubble-human-fg);
    border: 0;
    box-shadow: 0 10px 28px rgba(78, 94, 108, 0.08);
  }
  /* 每段最后一条:外下角收一个小尖 */
  .row.ai.tail .bubble{ border-bottom-left-radius: 2px; }
  .row.human.tail .bubble{ border-bottom-right-radius: 2px; }

  .bubble .txt{ white-space: normal; }
  .bubble.has-att{ display:flex; flex-direction:column; gap:6px; }
  .bubble.att-only{ background:transparent !important; padding:0 !important; box-shadow:none !important; }
  .att-img-link{ display:block; line-height:0; border-radius:14px; overflow:hidden; width:min(64vw,260px); aspect-ratio:var(--att-ratio, 1.04); max-height:340px; background:rgba(125,128,135,.10); }
  .att-img{ display:block; width:100%; height:100%; object-fit:cover; border-radius:14px; }
  .att-file{ display:flex; align-items:center; gap:10px; padding:9px 11px; min-width:170px; max-width:250px; text-decoration:none; color:inherit; background:rgba(125,128,135,.12); border-radius:12px; }
  .att-file-ic{ flex:0 0 auto; width:36px; height:36px; display:grid; place-items:center; border-radius:9px; background:rgba(125,128,135,.20); }
  .att-file-ic svg{ width:20px; height:20px; opacity:.85; }
  .att-file-meta{ display:flex; flex-direction:column; min-width:0; }
  .att-file-name{ font-size:13px; font-weight:600; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .att-file-size{ font-size:11px; opacity:.6; margin-top:2px; }
  .att-uploading{ opacity:.62; }
  .att-img-dead img{ display:none; }
  .att-img-dead::after{ content:"⚠ 图片已失效"; display:inline-block; padding:16px 20px; font-size:12px; color:var(--text-faint); background:rgba(125,128,135,.14); border-radius:14px; }
  .att-failed{ outline:1.5px solid #e3534d; outline-offset:1px; }
  .bubble .txt a{ color: inherit; text-decoration: underline; text-underline-offset: 2px; }
  .bubble .txt code{
    font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em;
    background: rgba(120,100,80,0.14); padding: 1px 5px; border-radius: 5px;
  }
  .bubble .txt strong{ font-weight: 700; }
  .meta{
    display:inline; margin-left: clamp(10px, 1.4vw, 16px); white-space: nowrap;
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(11px, 1.3vw, 14px); color: var(--text-faint); user-select:none;
    vertical-align: baseline;
  }
  .meta .sender{ color: var(--accent); margin-right: 7px; }
  .meta .tick{ color: var(--tick); margin-left: 7px; letter-spacing:0; }
  .meta .state{ color: var(--accent); }
  .meta .fail{ color:#c0533f; cursor:pointer; }
  .row.human .meta,
  .row.ai .meta{ color: var(--text-faint); }
  .row.human .meta .tick,
  .row.ai .meta .tick{ color: var(--tick); }
  /* 发送中:小时钟,转完即送达 → 同位换成 ✓✓ */
  .meta .tick.clock{ color: var(--tick); }
  .meta .tick.clock svg{ width: 1.05em; height: 1.05em; vertical-align: -0.18em; }

  /* ── thinking ── collapsed follows AI bubble; expanded becomes a quiet reading section ── */
  .row.think{
    justify-content: flex-start;
    padding-left: calc(var(--avatar-size) + clamp(10px, 1.6vw, 16px));
    padding-right: 0;
    margin-top: clamp(7px, 1.2vw, 12px);
    margin-bottom: clamp(10px, 1.8vw, 18px);
  }
  .row.think.think-open{
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin-top: clamp(20px, 3.2vw, 34px);
    margin-bottom: clamp(18px, 2.8vw, 28px);
  }
  .think-block{
    width: min(61vw, 506px);
    max-width: min(61vw, 506px);
    color: var(--think-body);
    text-align: left;
    animation: pop .24s cubic-bezier(.2,.8,.2,1) both;
  }
  .think-block.open{
    width: 100%;
    max-width: min(100%, 760px);
    text-align: center;
  }
  .think-toggle{
    appearance: none;
    -webkit-appearance: none;
    width: auto;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
  }
  .think-block.open .think-toggle{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(9px, 1.8vw, 14px);
  }
  .think-toggle:hover .think-caption{ color: var(--accent); }
  .think-toggle:active{ transform: translateY(1px); }
  .think-rule{
    display: none;
    position: relative;
    width: 100%;
    height: 1px;
    color: var(--think-flourish);
  }
  .think-block.open .think-rule{ display: block; }
  .think-rule::before{
    content: "";
    position: absolute;
    left: clamp(22px, 6vw, 64px);
    right: clamp(22px, 6vw, 64px);
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--think-flourish) 16%, var(--think-flourish) 84%, transparent);
    opacity: .46;
  }
  .think-caption{
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    color: var(--think-label);
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(12px, 1.38vw, 14px);
    line-height: 1.1;
    letter-spacing: .08em;
    transition: color var(--motion-fast) var(--ease-soft);
  }
  .think-caption-star,
  .think-state{
    color: var(--think-flourish);
    font-size: 1.18em;
    line-height: 1;
    transform: translateY(-.02em);
  }
  .think-block.open .think-caption-star{ display: none; }
  .think-state::before{ content: "✧"; }
  .think-block.open .think-state::before{ content: "✦"; }
  .think-body[hidden]{ display: none !important; }
  .think-body{
    margin-top: clamp(12px, 2.2vw, 20px);
  }
  .think-text{
    width: min(82%, 520px);
    margin: 0 auto clamp(16px, 2.6vw, 24px);
    color: var(--think-body);
    font-family: var(--font-cn);
    font-size: clamp(12px, 1.25vw, 13.5px);
    line-height: 1.72;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .think-starline{
    position: relative;
    width: 100%;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--think-flourish);
  }
  .think-starline::before,
  .think-starline::after{
    content: "";
    position: absolute;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--think-flourish) 15%, var(--think-flourish) 85%, transparent);
    opacity: .5;
  }
  .think-starline::before{ left: 0; right: calc(50% + 34px); }
  .think-starline::after{ left: calc(50% + 34px); right: 0; }
  .think-star{
    position: relative;
    z-index: 1;
    color: var(--think-flourish);
    display: grid;
    place-items: center;
  }
  .think-star svg{ width: 24px; height: 24px; display: block; }
  .think-copy{ min-width: 0; }
  .think-copy a{ color: inherit; text-decoration: underline; text-underline-offset: 2px; }
  .think-copy code{
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .9em;
    background: rgba(120,100,80,0.10);
    padding: 1px 5px;
    border-radius: 5px;
  }

  /* ── act ── the AI's action chip: a quiet "what it just did", optionally expand to see raw tool calls ──
     视觉与 thinking 同一族(--think-* 配色),但更小、更收,贴在头像缝隙里,不抢气泡 ── */
  .row.act{
    justify-content: flex-start;
    padding-left: calc(var(--avatar-size) + clamp(10px, 1.6vw, 16px));
    padding-right: clamp(12px, 4vw, 40px);
    margin-top: clamp(4px, 0.9vw, 9px);
    margin-bottom: clamp(4px, 0.9vw, 9px);
  }
  .act-block{
    max-width: min(80vw, 470px);
    animation: pop .24s cubic-bezier(.2,.8,.2,1) both;
  }
  .act-toggle{
    appearance: none; -webkit-appearance: none;
    margin: 0; padding: 2px 0; border: 0; background: transparent;
    color: inherit; font: inherit; cursor: pointer; text-align: left;
    max-width: 100%;
    display: inline-flex; align-items: baseline; gap: 7px;
  }
  .act-toggle.bare{ cursor: default; }
  .act-toggle:focus-visible{ outline: none; }
  .act-glyph{
    flex: none;
    color: var(--think-flourish);
    font-size: 1.04em; line-height: 1;
    transform: translateY(.06em);
  }
  .act-label{
    color: var(--think-label);
    font-family: var(--font-cn);                /* 统一宋体:--font-en 末尾的通用 serif 会先吃掉 CJK→iOS 回退黑体 */
    font-size: clamp(12px, 1.32vw, 13.5px);
    line-height: 1.46;
    letter-spacing: .02em;
  }
  /* 展开指示:沿用 thinking 的空心星 ✧(收起)→ 实心 ✦(展开),比"· 展开"文字更轻、不突兀 */
  .act-state{
    flex: none;
    color: var(--think-flourish);
    font-size: 1.1em;
    line-height: 1;
    transform: translateY(.02em);
    transition: color var(--motion-fast) var(--ease-soft);
  }
  .act-state::before{ content: "✧"; }
  .act-block.open .act-state::before{ content: "✦"; }
  .act-toggle:hover .act-state{ color: var(--accent); }
  .act-toggle:hover .act-label{ color: var(--think-body); }
  .act-toggle:active{ transform: translateY(1px); }
  .act-detail[hidden]{ display: none !important; }
  .act-detail{
    margin-top: 8px;
    border-radius: 12px;
    background: rgba(127,127,127,0.08);
    border: 1px solid var(--field-line);
    padding: clamp(9px, 1.6vw, 13px) clamp(11px, 1.8vw, 14px);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px; line-height: 1.6;
    color: var(--think-body);
    overflow-x: auto;
    animation: pop .2s cubic-bezier(.2,.8,.2,1) both;
  }
  .act-step + .act-step{
    margin-top: 7px; padding-top: 7px;
    border-top: 1px dashed var(--field-line);
  }
  .act-line{ white-space: pre-wrap; overflow-wrap: anywhere; }
  .act-k{ color: var(--text-faint); user-select: none; }
  .act-v{ color: var(--think-body); }


  /* ── Composer ── */
  .composer{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    width: min(100vw, var(--ref-width));
    margin: 0 auto;
    display:flex; align-items:center; gap: clamp(6px, 1vw, 12px);
    background: transparent; border:none;
    padding: 0 var(--side-pad) clamp(10px, 1.6vw, 18px);
    padding-bottom: calc(clamp(10px, 1.6vw, 18px) + env(safe-area-inset-bottom));
    transform: translate3d(0, calc(-1 * var(--keyboard-offset)), 0);
    -webkit-transform: translate3d(0, calc(-1 * var(--keyboard-offset)), 0);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
  }
  .floatbtn{
    flex:none; width: clamp(36px, 5vw, 48px); height: clamp(36px, 5vw, 48px); border-radius:50%;
    border: none; background: transparent;
    color: var(--accent); display:grid; place-items:center; cursor:pointer; padding:0;
    transition: transform .15s ease, color .2s ease;
  }
  .floatbtn:active{ transform: scale(.9); color: var(--text); }
  .floatbtn:hover{ color: var(--text); }
  .floatbtn svg{ width: clamp(20px, 2.8vw, 28px); height: clamp(20px, 2.8vw, 28px); display:block; }
  .floatbtn.send{
    background: var(--send-bg);
    color:#ffffff;
    box-shadow: 0 16px 32px rgba(41, 60, 78, 0.22);
  }
  .floatbtn.send:hover{ color:#ffffff; }
  .floatbtn.send:active{ transform: scale(.97); }      /* 发送键按压:轻收 3%(比通用 .floatbtn 的 .9 克制) */
  @keyframes send-go{ from{ transform: scale(.96); } to{ transform: scale(1); } }
  .floatbtn.send.send-go{ animation: send-go .22s cubic-bezier(.2,.8,.2,1); }
  @media (prefers-reduced-motion: reduce){ .floatbtn.send.send-go{ animation: none; } }
  .composer .field{
    flex:1 1 auto; display:flex; align-items:center; gap: clamp(4px, 0.8vw, 10px);
    background: var(--field-bg);
    border: 1px solid var(--field-line);
    border-radius: 999px;
    padding: clamp(4px, 0.6vw, 8px) clamp(8px, 1.2vw, 14px) clamp(4px, 0.6vw, 8px) clamp(10px, 1.5vw, 16px);
    min-height: clamp(42px, 5.5vw, 56px);
    box-shadow: var(--shadow);
    transition: border-color .2s ease;
  }
  .composer .field:focus-within{ border-color: var(--field-line); }
  .composer textarea:focus,
  .composer textarea:focus-visible,
  .composer button:focus-visible{
    outline: none;
  }
  textarea{
    flex:1 1 auto; border:none; outline:none; resize:none; background:transparent;
    color: var(--text); font-family: var(--font-en), var(--font-cn); font-size: clamp(15px, 2vw, 18px); line-height:1.35;
    max-height: 110px; padding: 6px 0; margin:0;
  }
  textarea::placeholder{ color: var(--text-faint); opacity: 1; }
  .emojibtn{
    flex:none; width: clamp(28px, 3.8vw, 38px); height: clamp(28px, 3.8vw, 38px); border:none; background:transparent;
    color: var(--accent); display:grid; place-items:center; cursor:pointer; padding:0;
    transition: transform .15s ease, color .2s ease;
  }
  .emojibtn:active{ transform: scale(.85); color: var(--text); }
  .emojibtn:hover{ color: var(--text); }
  .emojibtn svg{ width: clamp(22px, 3vw, 30px); height: clamp(22px, 3vw, 30px); display:block; }
  /* ── 回到最新 · 翻历史时来新消息,底部悬浮一枚安静的半透明胶囊 ── */
  .newmsg-pill{
    position: fixed; left: 50%; z-index: 90;
    bottom: calc(clamp(78px, 13vw, 96px) + env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px 7px 11px; border: none; border-radius: 999px;
    background: rgba(34, 46, 60, .52); color: #fff;
    font-family: var(--font-en), var(--font-cn); font-size: 13px; line-height: 1; letter-spacing: .01em;
    -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
    box-shadow: 0 8px 24px rgba(18, 28, 40, .26);
    cursor: pointer; opacity: 0; pointer-events: none;
    transform: translate3d(-50%, calc(8px - var(--keyboard-offset, 0px)), 0);
    transition: opacity .2s ease, transform .28s cubic-bezier(.2,.8,.2,1);
  }
  .newmsg-pill.show{ opacity: 1; pointer-events: auto; transform: translate3d(-50%, calc(-1 * var(--keyboard-offset, 0px)), 0); }
  .newmsg-pill svg{ width: 15px; height: 15px; flex: none; }
  @media (prefers-reduced-motion: reduce){ .newmsg-pill{ transition: opacity .2s ease; } }

  /* ── Login ── */
  .login{
    position: fixed; inset:0; z-index: 50;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap: 22px; padding: 28px;
    padding-top: calc(28px + env(safe-area-inset-top));
    background-color: var(--bg);
    background-image: var(--wall-default);
    background-size: cover;
    background-position: center;
  }
  .login .orb{
    width:72px; height:72px; border-radius:50%;
    background-image: var(--avatar-default);
    background-size: cover;
    box-shadow: 0 20px 42px rgba(24,46,67,0.2);
    animation: breathe 4.5s ease-in-out infinite;
  }
  .login h1{ margin:0; font-size:34px; font-weight:500; letter-spacing:0; }
  .login .sub{ margin:-12px 0 0; color: var(--text-soft); font-size:16px; text-align:center; }
  .login form{ display:flex; flex-direction:column; gap:11px; width:100%; max-width:320px; }
  .login input{
    width:100%; padding: 14px 16px; font: inherit; color: var(--text);
    background: var(--field-bg); border:1px solid var(--field-line); border-radius:18px; outline:none;
    transition: border-color .2s ease;
    box-shadow: var(--soft-shadow);
  }
  .login input:focus{ border-color: var(--accent); }
  .login button{
    width:100%; padding: 14px; font: inherit; font-weight:600;
    background: var(--accent); color: var(--accent-fg); border:none; border-radius:18px; cursor:pointer;
  }
  .login button:active{ transform: scale(.99); }
  .login .err{ color:#c0533f; font-size:13px; min-height:16px; text-align:center; margin:0; }
  .hidden{ display:none !important; }
  .app.kb .composer{ padding-bottom: 8px; }

  /* ── Profile page (full-screen settings) ── */
  .profile-panel{
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    transform: translateX(100%);
    opacity: 0;
    transition: transform .34s var(--ease-soft), opacity .26s ease;
  }
  .profile-panel.open{ transform: none; opacity: 1; pointer-events: auto; }
  /* own wallpaper layer so the chat behind is fully covered, theme-matched */
  .profile-page{
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    background-image: var(--wall-default);
    background-size: cover;
    background-position: center;
    overflow: hidden;
  }
  .profile-page::before{
    content:""; position:absolute; inset:0; background: var(--scrim); pointer-events:none;
  }
  .profile-topbar{
    position: relative; z-index:1;
    flex: 0 0 auto;
    display:flex; align-items:center; gap:10px;
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--side-pad) 0;
  }
  .profile-topbar h2{ margin:0; font-size:19px; font-weight:600; color:var(--text); }
  .profile-back{
    width:40px; height:40px; flex:none;
    border:0; border-radius:50%; padding:0; margin-left:-6px;
    background: transparent; color: var(--text);
    display:grid; place-items:center; cursor:pointer;
    transition: transform .15s ease;
  }
  .profile-back:active{ transform: scale(.9); }
  .profile-back svg{ width:24px; height:24px; display:block; }
  .profile-scroll{
    position: relative; z-index:1;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px var(--side-pad) calc(30px + env(safe-area-inset-bottom));
    display:flex; flex-direction:column; gap:24px;
  }
  .profile-scroll::-webkit-scrollbar{ width:0; height:0; }

  /* identity */
  .profile-identity{
    display:grid;
    grid-template-columns: auto 1fr;
    gap:18px; align-items:center;
    padding: 4px 4px 16px;
  }
  .profile-avatar{
    width:78px; height:78px; border-radius:50%;
    border:0; padding:0; overflow:hidden;
    -webkit-appearance:none; appearance:none;
    background-color:transparent;
    background-image: var(--avatar-default);
    background-size:cover; background-position:center;
    box-shadow: 0 12px 28px rgba(24,46,67,0.16);
    cursor:pointer; transition: transform .15s ease;
  }
  .profile-avatar:active{ transform: scale(.96); }
  .profile-id-copy{ min-width:0; }
  .profile-name-row{ display:flex; align-items:center; gap:9px; margin:0 0 5px; }
  .profile-name-row h3,
  #profileNameInput{
    margin:0;
    font-family: var(--font-en), var(--font-cn);
    font-size:23px; font-weight:500; letter-spacing:0;
    color: var(--text); line-height:1.1;
  }
  #profileNameInput{
    width:6.6em; max-width:62%;
    border:0; border-radius:10px;
    background: var(--seg-track); outline:none;
    padding:3px 11px; margin:-3px 0;
  }
  .profile-name-edit{
    width:26px; height:26px; flex:none;
    border:0; border-radius:50%; padding:0;
    background:transparent; color: var(--text-soft);
    display:grid; place-items:center; cursor:pointer;
    transition: color .2s ease, transform .15s ease;
  }
  .profile-name-edit:active{ transform: scale(.88); }
  .profile-name-edit svg{ width:15px; height:15px; display:block; }
  .profile-handle{
    display:flex; align-items:center; gap:7px; margin:0 0 8px;
    color: var(--text-soft);
    font-family: var(--font-en), var(--font-cn); font-size:13.5px;
  }
  .profile-bio{ margin:0; color: var(--text-soft); font-size:13px; line-height:1.55; }

  /* setting card */
  .settings-card{
    background: var(--card-bg);
    border: 1px solid var(--card-line);
    border-radius:18px;
    box-shadow: var(--card-shadow);
    padding:15px 16px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .settings-label{
    display:flex; align-items:center; gap:6px;
    color: var(--text-soft); font-size:12.5px;
    margin-bottom:11px; letter-spacing:.01em;
  }
  .info-i{
    width:14px; height:14px; flex:none; border-radius:50%;
    border:1px solid var(--info-ring); color: var(--text-faint);
    display:inline-grid; place-items:center;
    font-size:9px; font-style:normal; line-height:1;
    font-family: var(--font-en), var(--font-cn);
    cursor:help; user-select:none;
  }
  .push-hint{
    margin-top:9px; font-size:11.5px; line-height:1.55;
    color: var(--text-faint); letter-spacing:.01em;
  }
  .settings-intro{ padding:2px 4px 0; }
  .settings-intro h3{ margin:0 0 6px; font-size:25px; font-weight:600; color:var(--text); }
  .settings-intro p{ margin:0; color:var(--text-soft); font-size:13px; line-height:1.65; }
  .agent-settings-list{ display:flex; flex-direction:column; gap:12px; }
  .agent-settings-card{ padding:14px; }
  .agent-settings-head{ display:grid; grid-template-columns:48px 1fr auto; align-items:center; gap:10px; }
  .agent-settings-avatar{ width:48px; height:48px; border-radius:50%; background-size:cover; background-position:center; box-shadow:0 8px 18px rgba(45,62,78,.14); }
  .agent-settings-name{ font-size:16px; font-weight:600; color:var(--text); }
  .agent-settings-transport{ margin-top:2px; font-size:11px; color:var(--text-faint); }
  .agent-settings-state{ display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-soft); white-space:nowrap; }
  .agent-settings-state::before{ content:""; width:7px; height:7px; border-radius:50%; background:#aab3bb; }
  .agent-settings-state.online::before{ background:#55b985; }
  .agent-current-model{ margin:12px 0 8px; font-size:12px; color:var(--text-soft); }
  .agent-current-model strong{ color:var(--text); font-weight:600; }
  .agent-role{ font-size:11px; color:var(--text-faint); font-weight:400; margin-left:6px; }
  .agent-quota-row{ display:flex; align-items:center; gap:8px; margin-top:10px; font-size:11.5px; color:var(--text-faint); }
  .agent-quota-text{ flex:1 1 auto; min-width:0; }
  .agent-quota-refresh{ padding:5px 10px; font-size:11.5px; }
  .agent-persona{ margin-top:6px; min-height:90px; }

  /* ── 房间切换 / 表情包 / 参考库 ── */
  .room-tabs{
    flex:0 0 auto; display:flex; gap:4px; margin:8px var(--side-pad) 0;
    background:var(--seg-track); border-radius:999px; padding:3px;
    overflow-x:auto; scrollbar-width:none;
  }
  .room-tabs::-webkit-scrollbar{ display:none; }
  .room-tabs button{
    flex:0 0 auto; border:0; background:transparent; color:var(--text-soft);
    border-radius:999px; padding:6px 14px; font:inherit; font-size:12.5px; cursor:pointer; white-space:nowrap;
  }
  .room-tabs button.active{ background:var(--seg-thumb); color:var(--text); box-shadow:var(--seg-thumb-shadow); font-weight:500; }
  .sticker-inline{ width:1.4em; height:1.4em; vertical-align:-0.3em; }
  .inner-voice{ display:block; font-size:12px; line-height:1.5; color:var(--text-faint); font-style:italic; opacity:.9; margin:1px 0 3px; }
  .sticker-big{ width:88px; height:88px; display:block; }
  .sticker-pop{
    position:fixed; left:50%; transform:translateX(-50%);
    bottom: calc(var(--composer-zone) + 8px);
    z-index:120; width:min(92vw, 360px);
    background:var(--composer-bg); border:1px solid var(--hairline); border-radius:18px;
    box-shadow:var(--shadow); padding:10px;
    display:grid; grid-template-columns:repeat(auto-fill, minmax(44px, 1fr)); gap:6px;
    max-height:40vh; overflow:auto;
    -webkit-backdrop-filter:blur(20px) saturate(1.4); backdrop-filter:blur(20px) saturate(1.4);
  }
  .sticker-pop[hidden]{ display:none; }
  .sticker-pop button{ border:0; background:transparent; padding:4px; cursor:pointer; border-radius:10px; }
  .sticker-pop button:active{ background:var(--row-press); }
  .sticker-pop img{ width:36px; height:36px; display:block; margin:0 auto; }

  /* ── @提及选择器 ── */
  .mention-pop{
    position:fixed; z-index:130;
    left: calc(var(--side-pad) + 44px);
    bottom: calc(var(--composer-zone) + 8px);
    width:min(78vw, 300px);
    background:var(--composer-bg); border:1px solid var(--hairline); border-radius:16px;
    box-shadow:var(--shadow); padding:6px;
    -webkit-backdrop-filter:blur(20px) saturate(1.4); backdrop-filter:blur(20px) saturate(1.4);
    max-height:46vh; overflow:auto;
  }
  .mention-pop[hidden]{ display:none; }
  .mention-item{ display:flex; align-items:center; gap:10px; width:100%; border:0; background:transparent; padding:8px 9px; border-radius:11px; cursor:pointer; font:inherit; color:var(--text); text-align:left; }
  .mention-item.active, .mention-item:active{ background:var(--seg-track); }
  .mention-ava{ width:28px; height:28px; border-radius:50%; background-size:cover; background-position:center; flex:none; }
  .mention-all{ display:grid; place-items:center; background:var(--seg-track); color:var(--accent); font-weight:600; font-size:14px; }
  .mention-name{ font-size:13.5px; font-weight:600; }
  .mention-role{ font-size:11px; color:var(--text-faint); }
  @media (min-width:1024px){ .mention-pop{ left:calc(264px + var(--side-pad) + 44px); } }
  .lib-block{ flex:0 0 auto; margin-top: clamp(20px, 5vw, 34px); display:flex; flex-direction:column; gap:16px; }
  .lib-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
  .lib-name{ font-family:var(--font-en),var(--font-cn); font-size:12px; letter-spacing:.12em; color:var(--text-soft); }
  .lib-list{ display:flex; flex-direction:column; }
  .lib-item{ display:flex; align-items:center; gap:10px; padding:9px 2px; border-top:1px solid var(--hairline); font-size:13px; color:var(--text); }
  .lib-item-main{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .lib-item-meta{ font-size:11px; color:var(--text-faint); white-space:nowrap; }
  .lib-del{ flex:none; border:0; background:transparent; color:var(--text-faint); cursor:pointer; font-size:13px; padding:4px 6px; }
  .lib-empty{ font-size:11.5px; color:var(--text-faint); padding:8px 2px; }

  /* ── 引用可见 / 收藏星标 ── */
  .cite-line{ font-size:11px; color:var(--text-faint); }
  .citations{ font-size:11px; color:var(--text-faint); padding-left:2px; }
  .meta .star, .arch-item-head .star{ color:#d9a53a; margin-right:6px; }

  /* ── 归档 / 收藏列表 ── */
  .arch-day{ margin:18px 0 6px; font-size:12px; color:var(--text-faint); font-family:var(--font-en),var(--font-cn); }
  .arch-item{ padding:10px 4px; border-top:1px solid var(--hairline); font-size:13px; color:var(--text); }
  .arch-item-head{ display:flex; gap:8px; align-items:baseline; margin-bottom:3px; font-size:11.5px; color:var(--text-faint); }
  .arch-item-head strong{ color:var(--text-soft); font-weight:600; }
  .arch-item-text{ line-height:1.5; overflow-wrap:break-word; white-space:pre-wrap; max-height:4.5em; overflow:hidden; }
  .fav-item{ cursor:pointer; }
  .fav-item:active{ background:var(--row-press); }

  /* ── 桌面端左栏(≥1024px) ── */
  .sidebar{ display:none; }
  @media (min-width:1024px){
    .sidebar{
      display:flex; flex-direction:column; position:fixed; left:0; top:0; bottom:0; width:264px; z-index:5;
      padding: calc(env(safe-area-inset-top) + 22px) 16px 18px;
      border-right:1px solid var(--hairline);
      background: var(--card-bg);
      -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px);
    }
    .app{ left:264px; right:24px; width:auto; }
    .composer{ left:264px; right:24px; width:auto; }
    .room-tabs{ display:none; }
    .backbtn{ display:none; }
    .newmsg-pill{ left:calc(50% + 132px); }
    .sticker-pop{ left:calc(50% + 132px); }
  }
  .side-brand{ font-family:"Songti SC","Noto Serif SC",serif; font-size:22px; font-weight:600; color:var(--text); padding:4px 8px 18px; }
  .side-label{ font-size:11px; letter-spacing:.14em; color:var(--text-faint); padding:10px 8px 6px; }
  .side-rooms{ display:flex; flex-direction:column; gap:2px; }
  .side-room{ display:flex; align-items:center; gap:8px; border:0; background:transparent; color:var(--text); font:inherit; font-size:14px; padding:9px 10px; border-radius:12px; cursor:pointer; text-align:left; }
  .side-room.active{ background:var(--seg-track); font-weight:600; }
  .side-room .unread{ width:7px; height:7px; border-radius:50%; background:#e05a4d; margin-left:auto; }
  .side-agents{ display:flex; flex-direction:column; gap:2px; overflow:auto; }
  .side-agent{ display:flex; align-items:center; gap:9px; border:0; background:transparent; font:inherit; padding:7px 8px; border-radius:12px; cursor:pointer; text-align:left; color:var(--text); }
  .side-agent:active{ background:var(--row-press); }
  .side-agent-ava{ position:relative; width:32px; height:32px; border-radius:50%; background-size:cover; background-position:center; flex:none; }
  .side-agent-ava i{ position:absolute; right:-1px; bottom:0; width:8px; height:8px; border:2px solid rgba(255,255,255,.9); border-radius:50%; background:#aab3bb; }
  .side-agent.online .side-agent-ava i{ background:#55b985; }
  .side-agent-name{ font-size:13px; font-weight:600; display:block; line-height:1.2; }
  .side-agent-role{ font-size:11px; color:var(--text-faint); }
  .side-foot{ margin-top:auto; display:flex; flex-direction:column; gap:4px; padding-top:12px; border-top:1px solid var(--hairline); }
  .side-foot-btn{ border:0; background:transparent; color:var(--text-soft); font:inherit; font-size:13.5px; text-align:left; padding:9px 10px; border-radius:12px; cursor:pointer; }
  .side-foot-btn:active{ background:var(--row-press); }

  /* ── 施工面板(右侧 Inspector · 零黑箱) ── */
  .segmented{ overflow-x:auto; scrollbar-width:none; }
  .segmented::-webkit-scrollbar{ display:none; }
  .segmented button{ min-width:52px; }
  .inspector{ display:none; }
  .insp-head{ display:flex; align-items:center; justify-content:space-between; font-family:"Songti SC","Noto Serif SC",serif; font-size:16px; font-weight:600; color:var(--text); padding:2px 4px 0; }
  .insp-close{ display:none; border:0; background:transparent; color:var(--text-faint); font-size:14px; cursor:pointer; padding:4px 8px; }
  .insp-card{ background:var(--card-bg); border:1px solid var(--card-line); border-radius:16px; box-shadow:var(--card-shadow); padding:12px 13px; }
  .insp-label{ font-size:11px; letter-spacing:.12em; color:var(--text-faint); margin-bottom:8px; }
  .insp-room-cur{ font-size:14px; color:var(--text); font-weight:600; }
  .insp-room-others{ font-size:11px; color:var(--text-faint); margin-top:4px; line-height:1.6; }
  .insp-agent{ padding:8px 0; border-top:1px solid var(--hairline); }
  .insp-agent:first-of-type{ border-top:0; padding-top:0; }
  .insp-agent-head{ display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text); }
  .insp-dot{ width:7px; height:7px; border-radius:50%; background:#aab3bb; flex:none; }
  .insp-dot.on{ background:#55b985; }
  .insp-role{ font-size:10.5px; color:var(--text-faint); }
  .insp-agent-act{ font-size:11.5px; color:var(--text-soft); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .insp-agent-sub{ font-size:10.5px; color:var(--text-faint); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .insp-dp{ padding:7px 0; border-top:1px solid var(--hairline); display:flex; flex-direction:column; gap:2px; }
  .insp-dp:first-of-type{ border-top:0; padding-top:0; }
  .insp-dp-head{ font-size:11.5px; color:var(--text); }
  .insp-dp-sub{ font-size:10.5px; color:var(--text-faint); overflow-wrap:break-word; }
  .topbtn.inspector-toggle{ font-size:17px; }
  @media (min-width:1280px){
    .inspector{
      display:flex; flex-direction:column; gap:12px; position:fixed; right:0; top:0; bottom:0; width:280px; z-index:5;
      padding:22px 14px 18px; overflow-y:auto;
      border-left:1px solid var(--hairline); background:var(--card-bg);
      -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px);
    }
    .app{ left:264px; right:304px; width:auto; }
    .composer{ left:264px; right:304px; width:auto; }
    .topbtn.inspector-toggle{ display:none; }
    .newmsg-pill{ left:calc(50% + 132px - 140px); }
    .sticker-pop{ left:calc(50% + 132px - 140px); }
  }
  @media (max-width:520px){
    .topbtn.terminal{ display:none; }
  }
  @media (max-width:1279.5px){
    .inspector{
      display:flex; flex-direction:column; gap:12px; position:fixed; right:0; top:0; bottom:0; width:min(84vw,320px); z-index:280;
      padding:calc(env(safe-area-inset-top) + 18px) 14px 18px; overflow-y:auto;
      border-left:1px solid var(--hairline); background:var(--bg);
      box-shadow:-18px 0 50px rgba(30,45,62,.18);
      transform:translateX(102%); transition:transform .3s var(--ease-soft);
      pointer-events:none;
    }
    .inspector.open{ transform:none; pointer-events:auto; }
    .insp-close{ display:block; }
  }
  .model-choice-list{ display:flex; flex-wrap:wrap; gap:7px; }
  .model-choice{
    border:1px solid var(--card-line); background:var(--seg-track); color:var(--text-soft);
    border-radius:999px; padding:7px 10px; font:inherit; font-size:11.5px; cursor:pointer;
  }
  .model-choice.active{ border-color:var(--slider-thumb); color:var(--text); background:var(--seg-thumb); box-shadow:var(--seg-thumb-shadow); }
  .model-choice:disabled{ cursor:not-allowed; opacity:.48; }
  .secret-row{ position:relative; margin-top:10px; }
  .secret-row input{
    width:100%; box-sizing:border-box; border:1px solid var(--card-line); border-radius:12px;
    background:var(--seg-track); color:var(--text); font:inherit; font-size:13px; padding:11px 42px 11px 12px; outline:none;
  }
  .secret-row input:focus{ border-color:var(--slider-thumb); }
  .secret-toggle{ position:absolute; right:5px; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; border-radius:50%; background:transparent; color:var(--text-faint); cursor:pointer; }
  .settings-security{ display:flex; gap:8px; align-items:flex-start; margin-top:10px; color:var(--text-faint); font-size:11.5px; line-height:1.55; }
  .settings-security svg{ width:15px; height:15px; flex:none; margin-top:1px; }

  /* ── API loop cards(模型链 / 上文 / 人格 / MCP)── */
  .loop-rows{ display:flex; flex-direction:column; gap:8px; }
  .loop-row{ display:grid; grid-template-columns: 1fr auto; gap:6px; align-items:start; }
  .loop-row .loop-inputs{ display:grid; gap:6px; min-width:0; }
  .loop-field{ display:flex; flex-direction:column; gap:4px; font-size:11.5px; color: var(--text-faint); min-width:0; }
  .loop-field.wide{ grid-column: 1 / -1; }
  .loop-field input, .loop-field select, .loop-textarea, .loop-row input{
    width:100%; box-sizing:border-box; border:1px solid var(--card-line); border-radius:10px;
    background: var(--seg-track); color: var(--text); font: inherit; font-size:13px;
    padding:8px 10px; outline:none; -webkit-appearance:none; appearance:none;
  }
  .loop-field input:focus, .loop-field select:focus, .loop-textarea:focus, .loop-row input:focus{ border-color: var(--slider-thumb); }
  .loop-textarea{ resize:vertical; min-height:130px; line-height:1.5; font-size:12.5px; }
  .loop-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; }
  .loop-actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
  .loop-btn{
    border:1px solid var(--card-line); background: var(--seg-track); color: var(--text-soft);
    border-radius:10px; padding:7px 12px; font: inherit; font-size:12.5px; cursor:pointer; white-space:nowrap;
  }
  .loop-btn.primary{ background: var(--seg-thumb); color: var(--text); box-shadow: var(--seg-thumb-shadow); font-weight:500; }
  .loop-btn.danger{ color:#c0392b; }
  .loop-btn:disabled{ opacity:.55; cursor:default; }
  .loop-row-del{ align-self:center; padding:7px 9px; }
  .loop-mcp-item{ display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--card-line); border-radius:10px; background: var(--seg-track); }
  .loop-mcp-item .mcp-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
  .loop-mcp-item .mcp-name{ font-size:13px; color: var(--text); }
  .loop-mcp-item .mcp-meta{ font-size:11px; color: var(--text-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .loop-mcp-item .loop-btn{ padding:5px 8px; font-size:11.5px; }
  .mcp-dot{ width:8px; height:8px; border-radius:50%; background:#b8b8b8; flex:none; }
  .mcp-dot.online{ background:#3cb371; } .mcp-dot.error{ background:#e0553d; } .mcp-dot.connecting{ background:#e8b23a; }
  .loop-mcp-form{ margin-top:10px; }

  /* segmented control */
  .segmented{
    display:grid; grid-auto-flow:column; grid-auto-columns:1fr;
    gap:3px; background: var(--seg-track);
    border-radius:13px; padding:3px;
  }
  .segmented button{
    border:0; background:transparent; color: var(--text-soft);
    border-radius:10px; padding:8px 3px;
    font: inherit; font-size: clamp(10.5px, 2.9vw, 12.5px);
    letter-spacing:0; white-space:nowrap; cursor:pointer;
    transition: background .22s ease, color .22s ease, box-shadow .22s ease;
  }
  .segmented button.active{
    background: var(--seg-thumb); color: var(--text);
    box-shadow: var(--seg-thumb-shadow); font-weight:500;
  }

  /* context slider */
  .context-slider-wrap{ padding:4px 2px 2px; }
  .context-slider{
    -webkit-appearance:none; appearance:none;
    width:100%; height:4px; border-radius:999px;
    background: var(--slider-track);
    outline:none; cursor:pointer; margin:6px 0;
  }
  .context-slider::-webkit-slider-thumb{
    -webkit-appearance:none; appearance:none;
    width:21px; height:21px; border-radius:50%;
    background: var(--slider-thumb);
    border:2.5px solid var(--card-bg);
    box-shadow: 0 3px 10px rgba(24,46,67,.26); cursor:pointer;
  }
  .context-slider::-moz-range-thumb{
    width:21px; height:21px; border-radius:50%;
    background: var(--slider-thumb);
    border:2.5px solid var(--card-bg);
    box-shadow: 0 3px 10px rgba(24,46,67,.26); cursor:pointer;
  }
  .context-scale{
    display:flex; justify-content:space-between; margin-top:9px;
    color: var(--text-faint);
    font-family: var(--font-en), var(--font-cn); font-size:11.5px;
  }

  /* action rows */
  .action-row{
    display:flex; align-items:center; gap:13px;
    width:100%; text-align:left;
    background: var(--card-bg);
    border:1px solid var(--card-line);
    border-radius:16px; box-shadow: var(--card-shadow);
    padding:13px 16px; color: var(--text); font: inherit; cursor:pointer;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    transition: background .18s ease, transform .12s ease;
  }
  button.action-row:active{ background: var(--row-press); transform: scale(.992); }
  .action-icon{ width:21px; height:21px; flex:none; color: var(--accent); display:grid; place-items:center; }
  .action-icon svg{ width:19px; height:19px; display:block; }
  .action-name{ font-family: var(--font-en), var(--font-cn); font-size:14.5px; color: var(--text); flex:none; }
  .action-value{
    margin-left:auto; color: var(--text-soft); font-size:12.5px;
    text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .action-chevron{ flex:none; color: var(--text-faint); display:grid; place-items:center; margin-left:2px; }
  .action-chevron svg{ width:16px; height:16px; display:block; }
  .action-row.status{ cursor:default; }
  .action-row.status .status-main{ margin-left:auto; display:flex; flex-direction:column; align-items:flex-end; gap:2px; min-width:0; }
  .status-used{ color: var(--text); font-family: var(--font-en), var(--font-cn); font-size:13px; }
  .status-sid{ display:flex; align-items:center; gap:6px; color: var(--text-faint); font-size:11.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
  .status-copy{
    width:24px; height:24px; flex:none; border:0; border-radius:8px; padding:0;
    background:transparent; color: var(--text-soft);
    display:grid; place-items:center; cursor:pointer;
    transition: color .2s ease, transform .15s ease;
  }
  .status-copy:active{ transform: scale(.85); }
  .status-copy svg{ width:15px; height:15px; display:block; }

  /* toast */
  .toast{
    position: fixed; left:50%; bottom: calc(34px + env(safe-area-inset-bottom));
    transform: translate(-50%, 12px); z-index:320;
    max-width:min(88vw, 520px); min-width:128px;
    display:flex; align-items:flex-start; justify-content:center; gap:8px;
    background: rgba(20,34,48,.94); color:#eef5fb; font-size:14px; line-height:1.4;
    padding:11px 17px; border-radius:16px; text-align:left;
    box-shadow: 0 14px 34px rgba(0,0,0,.28);
    opacity:0; pointer-events:none;
    transition: opacity .24s ease, transform .24s ease;
  }
  .toast::before{ content:"✓"; flex:none; font-weight:700; color:#bfe8d2; }
  .toast.info::before{ content:"i"; color:#c9dcf6; }
  .toast.warning::before{ content:"!"; color:#ffe1a3; }
  .toast.error::before{ content:"×"; color:#ffc3c3; }
  .toast.show{ opacity:1; transform: translate(-50%, 0); }

  .prompt-dialog{ position:fixed; inset:0; z-index:310; display:grid; place-items:center; padding:22px; }
  .prompt-dialog.hidden{ display:none !important; }
  .prompt-dialog-scrim{ position:absolute; inset:0; background:rgba(25,38,52,.28); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
  .prompt-dialog-card{
    position:relative; width:min(100%, 380px); padding:24px; border-radius:24px;
    background:var(--panel-bg); border:1px solid var(--card-line); color:var(--text);
    box-shadow:0 24px 70px rgba(30,45,62,.24); text-align:center;
  }
  .prompt-dialog-icon{ width:40px; height:40px; margin:0 auto 10px; border-radius:14px; display:grid; place-items:center; background:var(--seg-track); color:var(--accent); font-size:18px; }
  .prompt-dialog-card h2{ margin:0; font-size:19px; font-weight:600; }
  .prompt-dialog-card p{ margin:8px 0 0; color:var(--text-soft); font-size:13px; line-height:1.55; }
  .prompt-dialog-field{ display:flex; flex-direction:column; align-items:stretch; gap:7px; margin-top:18px; text-align:left; }
  .prompt-dialog-field.hidden{ display:none; }
  .prompt-dialog-field > span{ color:var(--text-soft); font-size:12px; }
  .prompt-dialog-field input{ width:100%; box-sizing:border-box; border:1px solid var(--field-line); border-radius:13px; padding:11px 12px; background:var(--field-bg); color:var(--text); font:inherit; outline:none; }
  .prompt-dialog-field input:focus{ border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
  .prompt-dialog-field small{ min-height:15px; color:var(--text-faint); font-size:11px; }
  .prompt-dialog-field small.error{ color:#c05b59; }
  .prompt-dialog-actions{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:20px; }
  .prompt-dialog-actions button{ border:0; border-radius:13px; padding:11px 12px; font:inherit; cursor:pointer; }
  .prompt-dialog-cancel{ background:var(--seg-track); color:var(--text-soft); }
  .prompt-dialog-confirm{ background:var(--accent); color:white; }
  .prompt-dialog-confirm.danger{ background:#bd6666; }
  .prompt-dialog-actions button:disabled{ opacity:.55; cursor:default; }

  @media (max-width: 520px){
    :root{
      --side-pad: 16px;
      --header-h: 56px;
      --avatar-size: 32px;
    }
    .peerpill{ padding: 0 44px; }
    .peerpill .name{ font-size: 18px; }
    .peerpill .status{ font-size: 12px; margin-top: 3px; }
    .backbtn{ left: 16px; top: calc(env(safe-area-inset-top) + 16px); width: 32px; height: 32px; }
    .backbtn svg{ width: 20px; height: 20px; }
    .header-actions{ right: 16px; top: calc(env(safe-area-inset-top) + 16px); gap: 26px; height:32px; }
    .topbtn{ width:32px; height:32px; }
    .topbtn svg{ width:22px; height:22px; }
    .topbtn.more svg{ width:20px; height:20px; }
    .avatar{ right: 16px; top: calc(env(safe-area-inset-top) + 16px); }
    .row{ margin-top: 18px; }
    .row.grouped{ margin-top: 8px; }
    .row.ai{ padding-left: 42px; }
    .bubble{ max-width: min(63vw, 520px); font-size: 13.5px; line-height: 1.56; padding: 8px 13px 8px; }
    .meta{ font-size: 11px; margin-left: 8px; }
    .day{ font-size: 12px; }
    .new-divider{ font-size: 12px; margin: 14px 0 10px; }
    .composer{ gap: 5px; padding-left: 16px; padding-right: 16px; }
    .floatbtn{ width: 36px; height: 36px; }
    .floatbtn svg{ width: 20px; height: 20px; }
    .composer .field{ min-height: 42px; padding: 4px 8px 4px 12px; }
    textarea{ font-size: 15px; }
    .emojibtn{ width: 28px; height: 28px; }
    .emojibtn svg{ width: 22px; height: 22px; }
    .row.think{ padding-left: 42px; padding-right: 0; }
    .think-block{ width: min(63vw, 520px); max-width: min(63vw, 520px); }
    .think-block.open{ width: 100%; max-width: 100%; }
    .row.think.think-open{ padding-left: 0; padding-right: 0; }
    .think-caption{ font-size: 12.5px; letter-spacing: .07em; }
    .think-caption-star, .think-state{ font-size: 1.2em; }
    .think-body{ margin-top: 12px; }
    .think-text{ width: min(86%, 360px); font-size: 12px; line-height: 1.66; }
    .think-star svg{ width: 22px; height: 22px; }
    .profile-identity{ gap:15px; padding-bottom:14px; }
    .profile-avatar{ width:72px; height:72px; }
    .profile-name-row h3, #profileNameInput{ font-size:21px; }
    .profile-handle{ font-size:13px; }
    .profile-bio{ font-size:12.5px; }
    .settings-card{ padding:14px 15px; }
    .action-row{ padding:12px 15px; }
    .profile-scroll{ gap:22px; }
  }

  /* ── Menu (hub / home page · 从聊天页左箭头进入) ── */
  .menu-panel{
    position: fixed; inset: 0; z-index: 190;
    pointer-events: none;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform .38s var(--ease-soft), opacity .28s ease;
  }
  .menu-panel.open{ transform: none; opacity: 1; pointer-events: auto; }
  .menu-page{
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    background-color: var(--bg);
    background-image: var(--menu-wall-default);
    background-size: cover; background-position: center;
    overflow: hidden;
  }
  .menu-page::before{
    content:""; position:absolute; inset:0; background: var(--scrim); pointer-events:none;
  }
  .menu-scroll{
    position: relative; z-index: 1;
    flex: 1 1 auto; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    display: flex; flex-direction: column;
    padding: calc(env(safe-area-inset-top) + clamp(18px, 4vw, 30px)) clamp(26px, 7vw, 54px) calc(env(safe-area-inset-bottom) + clamp(20px, 5vw, 30px));
  }
  .menu-scroll::-webkit-scrollbar{ width:0; height:0; }

  /* header: 玻璃液态日夜 toggle(左) · PRIVATE SPACE(右) */
  .menu-head{
    flex: 0 0 auto;
    display:flex; align-items:flex-start; justify-content:space-between;
    margin-bottom: clamp(34px, 10vw, 68px);
  }
  /* (主题切换已移至设置页 #themeSeg;原菜单页玻璃 toggle 的 CSS 已随标记一并移除) */
  .menu-private{
    text-align:right; line-height:1.55;
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(9.5px, 2.5vw, 11px); letter-spacing:.24em;
    color: var(--text-soft); text-transform:uppercase;
  }
  .menu-private::after{
    content:""; display:block; margin-left:auto; margin-top:8px;
    width: clamp(20px, 5.5vw, 26px); height:1px; background: var(--text-faint); opacity:.6;
  }

  /* hero: app title · since · days */
  .menu-hero{ flex: 0 0 auto; margin-bottom: clamp(38px, 11vw, 72px); }
  .menu-title{
    font-family: "Pinyon Script", var(--font-en), cursive;
    font-weight: 400;
    font-size: clamp(46px, 15vw, 86px);
    line-height: 1.04;
    color: var(--text);
    margin: 0 0 clamp(16px, 4.4vw, 26px);
    letter-spacing: .005em;
    text-shadow: 0 2px 26px rgba(0,0,0,.16);
  }
  .menu-since{
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(11px, 2.9vw, 13.5px);
    letter-spacing:.14em; color: var(--text-soft);
    margin: 0 0 clamp(8px, 2.2vw, 12px);
  }
  .menu-days{
    display:flex; align-items:baseline; gap: clamp(8px, 2.6vw, 12px);
    font-family: var(--font-en), var(--font-cn); color: var(--text);
  }
  .menu-days .num{ font-size: clamp(30px, 8.4vw, 48px); font-weight:500; line-height:1; letter-spacing:.01em; }
  .menu-days .lab{ font-size: clamp(12px, 3.1vw, 15px); letter-spacing:.13em; color: var(--text-soft); }

  /* list */
  .menu-list{ flex: 0 0 auto; display:flex; flex-direction:column; }
  .menu-item{
    display:grid;
    grid-template-columns: clamp(22px, 6vw, 27px) auto 1fr auto;
    align-items:center; gap: clamp(12px, 3.4vw, 18px);
    width:100%; text-align:left;
    background:transparent; border:0;
    border-top:1px solid var(--hairline);
    padding: clamp(15px, 4.4vw, 21px) 2px;
    color: var(--text); font: inherit; cursor:pointer;
    transition: background .18s ease, transform .12s ease;
  }
  .menu-item:last-child{ border-bottom:1px solid var(--hairline); }
  .menu-item:active{ background: var(--row-press); transform: scale(.995); }
  .menu-ic{ display:grid; place-items:center; color: var(--text-soft); }
  .menu-ic svg{ width: clamp(19px, 5vw, 22px); height: clamp(19px, 5vw, 22px); display:block; }
  .menu-dot{ width:3px; height:3px; border-radius:50%; background: var(--text-faint); opacity:.5; }
  .menu-copy{ display:flex; flex-direction:column; min-width:0; }
  .menu-name{
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(18px, 5vw, 23px); font-weight:500; line-height:1.14;
    color: var(--text); margin-bottom:2px;
  }
  .menu-sub{
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(8.5px, 2.3vw, 10px); letter-spacing:.16em;
    text-transform:uppercase; color: var(--text-faint);
  }
  .menu-chev{ color: var(--text-faint); display:grid; place-items:center; }
  .menu-chev svg{ width:15px; height:15px; display:block; }

  /* footer */
  .menu-foot{
    flex: 1 1 auto;
    display:flex; align-items:flex-end; justify-content:center;
    text-align:center;
    padding-top: clamp(22px, 6vw, 40px);
    font-family: var(--font-en), var(--font-cn);
    font-size: clamp(10.5px, 2.7vw, 12.5px); font-style:italic;
    letter-spacing:.05em; color: var(--text-faint);
  }

  /* ── 长按气泡 · 复制菜单 (TG 式抬起+遮罩) ── */
  /* 长按由我们接管 → 彻底屏蔽聊天区(#scroll)的系统选择/放大镜/callout,否则和我们的菜单打架。
     用 !important 压过一切(含 iOS 误报 hover/pointer 的情况)。输入框在 #scroll 外,单独保持可选可编辑;
     气泡里要复制文字走长按菜单的 Copy。 */
  #scroll, #scroll *{
    -webkit-user-select:none !important; user-select:none !important;
    -webkit-touch-callout:none !important;
  }
  textarea, input, .composer, .composer *{
    -webkit-user-select:text !important; user-select:text !important;
    -webkit-touch-callout:default !important;
  }

  .msg-menu{ position:fixed; inset:0; z-index:250; opacity:0; pointer-events:none; }
  .msg-menu.open{ opacity:1; pointer-events:auto; }
  .msg-menu-scrim{
    position:absolute; inset:0;
    background:rgba(10,16,24,.30);
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
    opacity:0; transition:opacity .26s var(--ease-soft);
  }
  .msg-menu.open .msg-menu-scrim{ opacity:1; }
  .msg-menu-clone{
    position:fixed !important; margin:0 !important; animation:none !important;
    pointer-events:none; box-sizing:border-box;
    box-shadow:0 22px 50px rgba(18,34,52,.30);
    transform:scale(1); transition:transform .26s var(--ease-soft); will-change:transform;
  }
  .msg-menu.open .msg-menu-clone{ transform:scale(1.02); }
  .msg-menu-clone.clone-human{ background:var(--bubble-human-bg) !important; color:var(--bubble-human-fg) !important; }
  .msg-menu-clone.clone-ai{ background:var(--bubble-ai-bg) !important; color:var(--bubble-ai-fg) !important; }
  .msg-menu-actions{
    position:fixed; display:flex; flex-direction:column; min-width:150px; padding:5px;
    border-radius:16px; background:var(--composer-bg); border:1px solid var(--hairline);
    box-shadow:var(--shadow);
    -webkit-backdrop-filter:blur(20px) saturate(1.4); backdrop-filter:blur(20px) saturate(1.4);
    opacity:0; transform:translateY(8px) scale(.96); transform-origin:top center;
    transition:opacity .2s var(--ease-soft) .05s, transform .26s var(--ease-soft) .05s;
  }
  .msg-menu.open .msg-menu-actions{ opacity:1; transform:none; }
  .msg-act{
    appearance:none; -webkit-appearance:none; border:0; background:transparent; color:var(--text);
    font-family:var(--font-en), var(--font-cn); font-size:15px; display:flex; align-items:center; gap:11px;
    padding:10px 14px; border-radius:12px; cursor:pointer; text-align:left; width:100%;
    transition:background var(--motion-fast);
  }
  .msg-act:hover{ background:var(--row-press); }
  .msg-act:active{ background:var(--row-press); transform:scale(.98); }
  .msg-act svg{ width:18px; height:18px; opacity:.82; flex:0 0 auto; }
  .msg-act.danger{ color:#e05a4d; }                       /* 删除(仅本地) */

  /* ── reaction chips (AI poke) ── */
  .row.has-reactions{ flex-direction:column; gap:5px; }
  .row.human.has-reactions{ align-items:flex-end; }
  .row.ai.has-reactions{ align-items:flex-start; }
  .reactions{ display:flex; flex-wrap:wrap; gap:5px; max-width:min(61vw,506px); }
  .reaction{
    display:inline-flex; align-items:center; justify-content:center;
    font-size:15px; line-height:1; padding:4px 9px; border-radius:13px;
    background:var(--bubble-ai-bg); border:1px solid var(--hairline);
    box-shadow:0 4px 12px rgba(78,94,108,.12);
    -webkit-user-select:none; user-select:none;
  }
  .reaction.pop-in{ animation:reactionPop .52s cubic-bezier(.34,1.56,.5,1) both; }
  @keyframes reactionPop{
    0%{ transform:scale(0) rotate(-16deg); opacity:0; }
    55%{ transform:scale(1.22) rotate(5deg); opacity:1; }
    100%{ transform:none; opacity:1; }
  }

  @media (prefers-reduced-motion: reduce){
    *,
    *::before,
    *::after{
      animation: none !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

/* ═══════════════════════════════════════════════════════════════
   猪猪施工队 · 温馨手绘纸张主题
   The functional layout above stays intact; this layer translates it into
   the approved watercolor / colored-pencil visual system.
   ═══════════════════════════════════════════════════════════════ */
@font-face{
  font-family:"ZCOOL KuaiLe";
  font-style:normal;
  font-display:swap;
  font-weight:400;
  src:url("fonts/zcool-kuaile-cn-400.woff2") format("woff2");
}
html[data-theme="harbor"]{
  --wall-light:url("chat-handdrawn-v1.png");
  --wall-harbor:url("chat-handdrawn-v1.png");
  --wall-default:var(--wall-light);
  --menu-wall-light:url("chat-handdrawn-v1.png");
  --menu-wall-harbor:url("chat-handdrawn-v1.png");
  --menu-wall-default:var(--menu-wall-light);
  --font-hand:"ZCOOL KuaiLe","PingFang SC","Microsoft YaHei",sans-serif;
  --font-cn:var(--font-readable);
  --font-en:var(--font-readable);
  --bg:#f8f1e6;
  --header-bg:rgba(255,250,239,.91);
  --panel-bg:rgba(255,251,241,.96);
  --hairline:rgba(116,88,63,.16);
  --text:#234765;
  --text-soft:#687783;
  --text-faint:#9a968c;
  --bubble-ai-bg:rgba(255,253,246,.94);
  --bubble-ai-fg:#234765;
  --bubble-human-bg:rgba(255,239,198,.94);
  --bubble-human-fg:#4f493f;
  --accent:#3f6f99;
  --send-bg:#6fa7d7;
  --tick:#79a379;
  --composer-bg:rgba(255,249,237,.96);
  --field-bg:rgba(255,253,247,.94);
  --field-line:rgba(120,91,65,.18);
  --card-bg:rgba(255,251,241,.90);
  --card-line:rgba(125,92,62,.16);
  --card-shadow:0 9px 22px rgba(91,68,48,.09);
  --seg-track:rgba(220,232,234,.46);
  --seg-thumb:rgba(255,252,242,.98);
  --seg-line:rgba(125,92,62,.15);
  --seg-thumb-shadow:0 3px 10px rgba(91,68,48,.08);
  --row-press:rgba(155,194,218,.18);
  --slider-track:rgba(115,163,193,.22);
  --slider-thumb:#6d9fc7;
  --info-ring:rgba(91,117,138,.30);
  --status-dot:#63b77d;
  --shadow:0 12px 30px rgba(91,68,48,.12);
  --soft-shadow:0 7px 20px rgba(91,68,48,.08);
  --scrim:linear-gradient(180deg,rgba(255,252,244,.08),rgba(255,252,244,.28));
  --bubble-radius:16px;
}
:root[data-theme="harbor"]{
  --wall-default:var(--wall-harbor);
  --menu-wall-default:var(--menu-wall-harbor);
  --bg:#f7eee3;
  --header-bg:rgba(255,248,235,.92);
  --panel-bg:rgba(255,249,236,.96);
  --text:#4d4b48;
  --text-soft:#786f67;
  --text-faint:#a0978d;
  --bubble-ai-bg:rgba(255,252,242,.95);
  --bubble-ai-fg:#4d4b48;
  --bubble-human-bg:rgba(250,224,211,.95);
  --bubble-human-fg:#574941;
  --accent:#b66e62;
  --send-bg:#df8f7d;
  --tick:#79a379;
  --slider-thumb:#c98172;
}

html[data-theme="harbor"] body{
  background:#efe6d8 url("chat-handdrawn-v1.png") center/cover fixed no-repeat;
  font-family:var(--font-readable);
  letter-spacing:.015em;
}
html[data-theme="harbor"] button, html[data-theme="harbor"] input, html[data-theme="harbor"] textarea, html[data-theme="harbor"] select{ font-family:var(--font-readable); }
html[data-theme="harbor"] .terminal-panel, html[data-theme="harbor"] .terminal-panel textarea, html[data-theme="harbor"] .bubble code, html[data-theme="harbor"] .act-detail{
  font-family:"SFMono-Regular",Consolas,"Cascadia Mono",monospace;
}
html[data-theme="harbor"] .wall{
  background-color:#f8f1e6;
  background-image:var(--wall-default);
  filter:saturate(.92) contrast(.98);
}
html[data-theme="harbor"] .wall::after{
  background:linear-gradient(180deg,rgba(255,252,244,.12),rgba(255,249,239,.42) 44%,rgba(255,247,234,.18));
}

/* Header becomes a softly torn note rather than a glass toolbar. */
html[data-theme="harbor"] .topbar{
  background:rgba(255,251,241,.84);
  border-bottom:1px solid rgba(128,95,67,.13);
  box-shadow:0 5px 16px rgba(91,68,48,.06);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
html[data-theme="harbor"] .topbar::before{
  content:"";
  position:absolute;
  width:54px;
  height:17px;
  top:3px;
  left:50%;
  transform:translateX(-50%) rotate(-1deg);
  border-radius:3px;
  background:rgba(238,164,151,.30);
  background-image:repeating-linear-gradient(45deg,transparent 0 5px,rgba(255,255,255,.28) 5px 8px);
  pointer-events:none;
}
html[data-theme="harbor"] .peerpill .name, html[data-theme="harbor"] .side-brand, html[data-theme="harbor"] .insp-head, html[data-theme="harbor"] .profile-topbar h2, html[data-theme="harbor"] .settings-intro h3{
  font-family:var(--font-hand);
  color:#214d70;
  font-weight:700;
  letter-spacing:.04em;
}
html[data-theme="harbor"] .peerpill .status::before{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:7px;
  border-radius:50%;
  background:var(--status-dot);
  box-shadow:0 0 0 3px rgba(99,183,125,.12);
}
html[data-theme="harbor"] .backbtn, html[data-theme="harbor"] .topbtn{
  color:#345f7e;
  border:1px solid rgba(121,94,68,.10);
  background:rgba(255,251,241,.68);
  box-shadow:0 4px 10px rgba(91,68,48,.05);
}

/* Agent roster: one notebook strip with sticker-like portraits. */
html[data-theme="harbor"] .agent-strip{
  gap:10px;
  margin:10px var(--side-pad) 0;
  padding:10px 12px;
  border:1px solid rgba(126,94,65,.13);
  border-radius:18px 13px 20px 14px;
  background:rgba(255,250,238,.88);
  box-shadow:0 7px 18px rgba(91,68,48,.08);
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
}
html[data-theme="harbor"] .agent-chip{
  min-width:132px;
  padding:5px 8px;
  border:0;
  border-radius:14px;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
}
html[data-theme="harbor"] .agent-chip:hover{ background:rgba(198,222,231,.22); }
html[data-theme="harbor"] .agent-chip-avatar{
  border:3px solid rgba(255,255,255,.88);
  box-shadow:0 5px 12px rgba(82,57,36,.13);
}
html[data-theme="harbor"] .agent-chip-name{ font-family:var(--font-readable); color:#274f6d; font-size:14px; }
html[data-theme="harbor"] .agent-chip-model{ color:#8c8a83; }

/* Chat canvas and paper bubbles. */
html[data-theme="harbor"] .scroll{
  padding-top:22px;
  -webkit-mask-image:none;
  mask-image:none;
  scrollbar-width:thin;
  scrollbar-color:rgba(79,119,149,.22) transparent;
}
html[data-theme="harbor"] .scroll::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(90deg,rgba(255,255,255,.12),transparent 16%,transparent 84%,rgba(255,255,255,.10));
}
html[data-theme="harbor"] .day{
  padding:4px 12px;
  border:1px dashed rgba(104,112,112,.16);
  border-radius:999px;
  background:rgba(255,251,242,.62);
  font-family:var(--font-readable);
}
html[data-theme="harbor"] .row{ z-index:1; }
html[data-theme="harbor"] .row.ai::before{
  border:3px solid rgba(255,255,255,.9);
  box-shadow:0 5px 14px rgba(83,58,38,.14);
}
html[data-theme="harbor"] .bubble{
  font-family:var(--font-readable);
  border:1px solid rgba(126,94,65,.12) !important;
  box-shadow:0 6px 14px rgba(91,68,48,.08) !important;
  letter-spacing:.01em;
}
html[data-theme="harbor"] .row.ai .bubble{
  background:rgba(255,253,247,.94);
  border-radius:8px 17px 15px 17px;
}
html[data-theme="harbor"] .row.human .bubble{
  background:rgba(255,238,198,.95);
  border-radius:17px 8px 17px 15px;
}
html[data-theme="harbor"] .row.ai:nth-of-type(4n+2) .bubble{ background:rgba(231,244,250,.94); }
html[data-theme="harbor"] .row.ai:nth-of-type(4n+3) .bubble{ background:rgba(255,237,230,.94); }
html[data-theme="harbor"] .row.ai.tail .bubble{ border-bottom-left-radius:5px; }
html[data-theme="harbor"] .row.human.tail .bubble{ border-bottom-right-radius:5px; }
html[data-theme="harbor"] .meta{ font-family:var(--font-readable); color:#87939a; }
html[data-theme="harbor"] .meta .sender{ color:#3f6f99; font-weight:700; }
html[data-theme="harbor"] .think-block, html[data-theme="harbor"] .act-block{
  padding:8px 12px;
  border-left:2px dashed rgba(87,135,168,.28);
  border-radius:0 13px 13px 0;
  background:rgba(255,252,244,.48);
}
html[data-theme="harbor"] .new-divider::before, html[data-theme="harbor"] .new-divider::after{ background:rgba(87,135,168,.20); }

/* Paper composer with tactile controls. */
html[data-theme="harbor"] .composer{
  padding-top:9px;
  background:linear-gradient(180deg,transparent,rgba(249,241,227,.78) 24%,rgba(249,241,227,.96));
}
html[data-theme="harbor"] .composer .field{
  min-height:52px;
  border-radius:18px 14px 19px 15px;
  border:1px solid rgba(127,93,64,.16);
  background:rgba(255,252,244,.96);
  box-shadow:0 7px 18px rgba(91,68,48,.10);
}
html[data-theme="harbor"] .composer textarea{
  color:#334e60;
  font-family:var(--font-readable);
}
html[data-theme="harbor"] .composer textarea::placeholder{ color:#aaa397; }
html[data-theme="harbor"] .floatbtn, html[data-theme="harbor"] .emojibtn{ color:#315f82; }
html[data-theme="harbor"] .floatbtn.send{
  border-radius:15px 18px 16px 19px;
  background:#6fa7d7;
  box-shadow:0 7px 14px rgba(65,111,148,.20);
}
html[data-theme="harbor"] .clip-in-field{
  border-radius:12px;
  background:rgba(224,236,239,.46);
}

/* Shared paper controls: session popovers, settings, dialogs and menus. */
html[data-theme="harbor"] .session-pop, html[data-theme="harbor"] .settings-card, html[data-theme="harbor"] .insp-card, html[data-theme="harbor"] .action-row, html[data-theme="harbor"] .prompt-dialog-card, html[data-theme="harbor"] .sticker-pop, html[data-theme="harbor"] .mention-pop{
  border-color:rgba(126,94,65,.14);
  background:rgba(255,251,241,.96);
  box-shadow:0 10px 26px rgba(91,68,48,.12);
}
html[data-theme="harbor"] .session-pop{ border-radius:14px 19px 15px 18px; }
html[data-theme="harbor"] .session-item{ border:1px solid transparent; }
html[data-theme="harbor"] .session-item:hover, html[data-theme="harbor"] .session-item.active{
  border-color:rgba(99,150,181,.18);
  background:rgba(207,229,237,.36);
}
html[data-theme="harbor"] .session-name{ color:#2d536e; }
html[data-theme="harbor"] .session-new, html[data-theme="harbor"] .side-session-new, html[data-theme="harbor"] .loop-btn, html[data-theme="harbor"] .model-choice{
  border-color:rgba(117,92,68,.14);
  background:rgba(255,249,236,.92);
  color:#416a86;
  box-shadow:0 3px 8px rgba(91,68,48,.06);
}
html[data-theme="harbor"] .profile-panel, html[data-theme="harbor"] .menu-panel{ background:rgba(239,230,216,.34); }
html[data-theme="harbor"] .profile-page, html[data-theme="harbor"] .menu-page{
  background-color:#f8f1e6;
  background-image:url("chat-handdrawn-v1.png");
  background-size:cover;
  background-position:center;
}
html[data-theme="harbor"] .profile-topbar{
  background:rgba(255,251,241,.88);
  border-bottom:1px solid rgba(126,94,65,.13);
}
html[data-theme="harbor"] .segmented{ border:1px solid rgba(126,94,65,.10); }
html[data-theme="harbor"] .segmented button.active{ color:#315f82; }
html[data-theme="harbor"] .toast{
  background:rgba(48,78,97,.93);
  border:1px solid rgba(255,255,255,.30);
  box-shadow:0 12px 28px rgba(74,55,38,.20);
}

/* Mobile keeps one-column ergonomics while using the same hand-drawn system. */
@media (max-width:1023.5px){
  html[data-theme="harbor"] .app{ background:rgba(255,249,238,.10); }
  html[data-theme="harbor"] .topbar{ min-height:calc(72px + env(safe-area-inset-top)); }
  html[data-theme="harbor"] .peerpill .name{ font-family:var(--font-readable); font-size:22px; font-weight:700; }
  html[data-theme="harbor"] .agent-strip{ margin-top:6px; }
  html[data-theme="harbor"] .agent-chip{ min-width:118px; grid-template-columns:36px 1fr; }
  html[data-theme="harbor"] .bubble{ max-width:min(74vw,560px); }
  html[data-theme="harbor"] .row.ai, html[data-theme="harbor"] .row.think{ padding-left:calc(var(--avatar-size) + 11px); }
  html[data-theme="harbor"] .composer{ padding-bottom:calc(9px + env(safe-area-inset-bottom)); }
  html[data-theme="harbor"] .inspector{ background:#f8f1e6 url("chat-handdrawn-v1.png") center/cover no-repeat; }
}

/* Desktop notebook composition. */
@media (min-width:1024px){
  html[data-theme="harbor"] body{ background-color:#eee4d5; }
  html[data-theme="harbor"] .sidebar{
    left:18px;
    top:18px;
    bottom:18px;
    width:276px;
    padding:28px 18px 18px 30px;
    border:1px solid rgba(126,94,65,.15);
    border-radius:20px 15px 18px 22px;
    background:rgba(255,250,238,.94);
    box-shadow:0 12px 30px rgba(91,68,48,.12);
    backdrop-filter:blur(10px);
    overflow:hidden;
  }
  html[data-theme="harbor"] .sidebar::before{
    content:"";
    position:absolute;
    left:8px;
    top:22px;
    bottom:22px;
    width:12px;
    background:radial-gradient(circle,rgba(124,104,83,.26) 0 3px,transparent 3.5px) center top/12px 34px repeat-y;
    pointer-events:none;
  }
  html[data-theme="harbor"] .sidebar::after{
    content:"♡";
    position:absolute;
    right:20px;
    top:33px;
    color:#e99a94;
    font-family:var(--font-readable);
    font-size:24px;
    transform:rotate(-10deg);
  }
  html[data-theme="harbor"] .side-brand{ padding:3px 8px 24px; font-size:25px; }
  html[data-theme="harbor"] .side-label{ font-family:var(--font-readable); font-weight:700; color:#6f7c83; }
  html[data-theme="harbor"] .side-section-head{ display:flex; align-items:center; justify-content:space-between; margin-top:12px; }
  html[data-theme="harbor"] .side-section-head .side-label{ flex:1; }
  html[data-theme="harbor"] .side-session-new{
    width:28px;
    height:28px;
    border-radius:10px;
    padding:0;
    font-size:19px;
    line-height:1;
    cursor:pointer;
  }
  html[data-theme="harbor"] .side-rooms{ gap:4px; }
  html[data-theme="harbor"] .side-room{
    position:relative;
    padding:10px 12px 10px 29px;
    border:1px solid transparent;
    border-radius:10px 14px 11px 13px;
    color:#34566c;
    font-family:var(--font-readable);
    font-size:15px;
  }
  html[data-theme="harbor"] .side-room::before{ content:"○"; position:absolute; left:10px; color:#7395aa; font-size:13px; }
  html[data-theme="harbor"] .side-room.active{
    border-color:rgba(103,157,190,.18);
    background:rgba(194,223,238,.55);
    box-shadow:inset 0 0 16px rgba(255,255,255,.28);
  }
  html[data-theme="harbor"] .side-room.active::before{ content:"●"; color:#6ca5cd; }
  html[data-theme="harbor"] .side-sessions{
    display:flex;
    flex-direction:column;
    gap:3px;
    min-height:0;
    overflow-y:auto;
    padding-right:2px;
  }
  html[data-theme="harbor"] .side-sessions .session-item{ padding:9px 9px; border-radius:10px 13px 10px 12px; }
  html[data-theme="harbor"] .side-sessions .session-name{ max-width:164px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
  html[data-theme="harbor"] .side-sessions .session-meta{ font-size:9.5px; }
  html[data-theme="harbor"] .side-sessions .session-rename{ width:24px; height:24px; }
  html[data-theme="harbor"] .side-agents[hidden]{ display:none !important; }
  html[data-theme="harbor"] .side-foot{ border-top:1px dashed rgba(125,93,65,.18); }
  html[data-theme="harbor"] .side-foot-btn{ color:#4b6c81; border-radius:10px; }

  html[data-theme="harbor"] .app{
    left:312px;
    right:18px;
    top:18px;
    bottom:18px;
    width:auto;
    max-width:none;
    height:auto;
    border:1px solid rgba(126,94,65,.14);
    border-radius:22px 18px 24px 17px;
    background:rgba(255,250,239,.72);
    box-shadow:0 14px 34px rgba(91,68,48,.13);
  }
  html[data-theme="harbor"] .topbar{ flex:0 0 auto; border-radius:inherit; border-bottom-left-radius:0; border-bottom-right-radius:0; }
  html[data-theme="harbor"] .composer{
    left:312px;
    right:18px;
    bottom:18px;
    width:auto;
    max-width:none;
    border-radius:0 0 22px 17px;
  }
  html[data-theme="harbor"] .newmsg-pill{ left:calc(50% + 147px); }
  html[data-theme="harbor"] .sticker-pop{ left:calc(50% + 147px); }
  html[data-theme="harbor"] .mention-pop{ left:calc(312px + var(--side-pad)); }
}

/* Wide desktop reveals the right construction panel. */
@media (min-width:1280px){
  html[data-theme="harbor"] .inspector{
    right:18px;
    top:18px;
    bottom:18px;
    width:314px;
    padding:24px 16px 18px;
    border:1px solid rgba(126,94,65,.15);
    border-radius:17px 22px 19px 15px;
    background:rgba(255,250,238,.94);
    box-shadow:0 12px 30px rgba(91,68,48,.12);
    backdrop-filter:blur(10px);
  }
  html[data-theme="harbor"] .inspector::before{
    content:"";
    position:absolute;
    width:64px;
    height:18px;
    right:28px;
    top:0;
    transform:translateY(-3px) rotate(3deg);
    border-radius:3px;
    background:rgba(238,164,151,.32);
    background-image:repeating-linear-gradient(45deg,transparent 0 5px,rgba(255,255,255,.28) 5px 8px);
    pointer-events:none;
  }
  html[data-theme="harbor"] .insp-head{ font-size:23px; padding:0 5px 5px; }
  html[data-theme="harbor"] .insp-card{ border-radius:12px 17px 13px 16px; padding:13px; }
  html[data-theme="harbor"] .insp-label{ font-family:var(--font-readable); font-weight:700; color:#647883; }
  html[data-theme="harbor"] .insp-agent{ padding:11px 0; border-top:1px dashed rgba(125,93,65,.16); }
  html[data-theme="harbor"] .insp-agent-head{ display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:8px; align-items:center; }
  html[data-theme="harbor"] .insp-agent-avatar{ position:relative; width:38px; height:38px; border-radius:50%; background-size:cover; background-position:center; border:2px solid white; box-shadow:0 4px 10px rgba(82,58,38,.11); }
  html[data-theme="harbor"] .insp-agent-avatar .insp-dot{ position:absolute; right:-2px; bottom:0; border:2px solid white; width:9px; height:9px; }
  html[data-theme="harbor"] .insp-agent-copy{ min-width:0; display:flex; flex-direction:column; line-height:1.22; }
  html[data-theme="harbor"] .insp-agent-copy strong{ color:#2f536b; font-family:var(--font-readable); font-size:14px; }
  html[data-theme="harbor"] .insp-role{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  html[data-theme="harbor"] .insp-online{ padding:3px 7px; border-radius:999px; background:rgba(111,190,131,.12); color:#4c9665; font-size:9px; }
  html[data-theme="harbor"] .insp-agent-act{ margin-left:46px; }
  html[data-theme="harbor"] .insp-agent-sub{ margin-left:46px; color:#78909f; }
  html[data-theme="harbor"] .insp-quota-line{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin:8px 0 4px 46px; color:#969086; font-size:9.5px; }
  html[data-theme="harbor"] .insp-quota-line strong{ max-width:145px; color:#456a80; font-size:10px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  html[data-theme="harbor"] .insp-quota-track{ height:5px; margin-left:46px; border-radius:99px; overflow:hidden; background:rgba(105,134,148,.13); }
  html[data-theme="harbor"] .insp-quota-track i{ display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#80b7dc,#f0bd69); }
  html[data-theme="harbor"] .insp-refresh{ margin:4px 0 0 46px; color:#aaa096; font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  html[data-theme="harbor"] .insp-dp{ border-top:1px dashed rgba(125,93,65,.16); }

  html[data-theme="harbor"] .app{ right:374px; }
  html[data-theme="harbor"] .composer{ right:374px; }
  html[data-theme="harbor"] .newmsg-pill{ left:calc(50% + 147px - 166px); }
  html[data-theme="harbor"] .sticker-pop{ left:calc(50% + 147px - 166px); }
}

@media (min-width:1540px){
  html[data-theme="harbor"] .sidebar{ width:292px; }
  html[data-theme="harbor"] .app, html[data-theme="harbor"] .composer{ left:330px; }
  html[data-theme="harbor"] .mention-pop{ left:calc(330px + var(--side-pad)); }
}

/* ═══════════════════════════════════════════════════════════════
   生成稿配色校准：蓝天画布、便利贴面板、按 Agent 固定气泡色。
   正文使用系统中文字体保证可读性，手写字体只用于标题装饰。
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="bluesky"]{
  --font-readable:"PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Microsoft YaHei",system-ui,sans-serif;
  --sky-blue:#cfeaf7;
  --paper:#fffaf0;
  --paper-strong:#fffdf7;
  --selected-blue:#d7edf8;
  --ink:#244b68;
  --muted-ink:#738797;
}

html[data-theme="bluesky"] body, html[data-theme="bluesky"] button, html[data-theme="bluesky"] input, html[data-theme="bluesky"] textarea, html[data-theme="bluesky"] select{ font-family:var(--font-readable); }

html[data-theme="bluesky"] .wall{
  background-color:var(--sky-blue);
}

html[data-theme="bluesky"] .bubble, html[data-theme="bluesky"] .meta, html[data-theme="bluesky"] .agent-chip-model, html[data-theme="bluesky"] .session-item, html[data-theme="bluesky"] .side-room, html[data-theme="bluesky"] .side-sessions, html[data-theme="bluesky"] .side-foot-btn, html[data-theme="bluesky"] .insp-card, html[data-theme="bluesky"] .settings-card, html[data-theme="bluesky"] .composer textarea{
  font-family:var(--font-readable);
}

html[data-theme="bluesky"] .message-stack{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  min-width:0;
  max-width:min(61vw,506px);
}
html[data-theme="bluesky"] .row.human .message-stack{ align-items:flex-end; }
html[data-theme="bluesky"] .message-stack .bubble{ max-width:100%; }
html[data-theme="bluesky"] .message-stack .meta{
  display:flex;
  align-items:center;
  gap:7px;
  min-height:18px;
  margin:0 8px 5px;
  color:var(--muted-ink);
  font-size:12px;
  line-height:1.25;
  letter-spacing:.01em;
  white-space:nowrap;
}
html[data-theme="bluesky"] .row.human .message-stack .meta{ justify-content:flex-end; }
html[data-theme="bluesky"] .message-stack .meta .sender{
  margin:0;
  color:#315e7e;
  font-weight:650;
}
html[data-theme="bluesky"] .message-stack .meta .time{ color:#8b989f; font-variant-numeric:tabular-nums; }
html[data-theme="bluesky"] .message-stack .meta .tick{ margin-left:0; }

html[data-theme="bluesky"] .bubble{
  color:var(--ink);
  font-size:clamp(14px,1.45vw,16px);
  font-weight:400;
  line-height:1.62;
  letter-spacing:.01em;
  border-width:1px !important;
  border-style:solid !important;
  box-shadow:0 5px 13px rgba(84,73,58,.09) !important;
}

/* GG / Codex：米白纸；KK / Kimi：暖黄便签；DD / DeepSeek：天空蓝；XX / Grok：桃粉纸。 */
html[data-theme="bluesky"] .row.ai.agent-codex .bubble, html[data-theme="bluesky"] .row.ai.agent-assistant .bubble{
  background:rgba(255,253,246,.97);
  border-color:rgba(127,103,78,.15) !important;
  border-radius:8px 19px 14px 18px;
}
html[data-theme="bluesky"] .row.ai.agent-kimi .bubble{
  background:rgba(255,239,193,.97);
  border-color:rgba(205,161,76,.20) !important;
  border-radius:19px 8px 18px 13px;
}
html[data-theme="bluesky"] .row.ai.agent-deepseek .bubble{
  background:rgba(218,240,250,.97);
  border-color:rgba(91,157,190,.18) !important;
  border-radius:10px 20px 11px 18px;
}
html[data-theme="bluesky"] .row.ai.agent-grok .bubble{
  background:rgba(252,226,226,.97);
  border-color:rgba(206,125,130,.17) !important;
  border-radius:18px 12px 20px 9px;
}
html[data-theme="bluesky"] .row.human .bubble{
  background:rgba(221,240,222,.97);
  border-color:rgba(101,160,111,.17) !important;
  border-radius:18px 9px 17px 14px;
}
html[data-theme="bluesky"] .row.ai:nth-of-type(4n+2) .bubble, html[data-theme="bluesky"] .row.ai:nth-of-type(4n+3) .bubble{ /* cancel the old position-based color rotation */
  background:inherit;
}
html[data-theme="bluesky"] .row.ai.agent-codex:nth-of-type(n) .bubble, html[data-theme="bluesky"] .row.ai.agent-assistant:nth-of-type(n) .bubble{ background:rgba(255,253,246,.97); }
html[data-theme="bluesky"] .row.ai.agent-kimi:nth-of-type(n) .bubble{ background:rgba(255,239,193,.97); }
html[data-theme="bluesky"] .row.ai.agent-deepseek:nth-of-type(n) .bubble{ background:rgba(218,240,250,.97); }
html[data-theme="bluesky"] .row.ai.agent-grok:nth-of-type(n) .bubble{ background:rgba(252,226,226,.97); }

html[data-theme="bluesky"] .side-room.active, html[data-theme="bluesky"] .session-item.active, html[data-theme="bluesky"] .session-item:hover{
  background:var(--selected-blue);
  border-color:rgba(91,157,190,.22);
}

@media (max-width:1023.5px){
  html[data-theme="bluesky"] .message-stack{ max-width:min(74vw,560px); }
}

@media (min-width:1024px){
  /* 横屏不能再把竖版壁纸 cover 裁到中间；改为与生成稿一致的蓝天手绘画布。 */
  html[data-theme="bluesky"] .wall{
    background-image:
      radial-gradient(ellipse at 10% 9%,rgba(255,255,255,.82) 0 3.2%,transparent 3.5%),
      radial-gradient(ellipse at 15% 8%,rgba(255,255,255,.72) 0 3.7%,transparent 4%),
      radial-gradient(ellipse at 79% 6%,rgba(255,255,255,.74) 0 3.4%,transparent 3.8%),
      repeating-linear-gradient(118deg,rgba(80,151,188,.035) 0 1px,transparent 1px 8px),
      linear-gradient(180deg,#d9f0fa 0%,#cce9f6 56%,#d7edf6 100%) !important;
    background-size:auto,auto,auto,auto,auto;
    filter:none;
  }
  html[data-theme="bluesky"] .wall::after{
    background:
      radial-gradient(circle at 7% 92%,rgba(116,177,116,.20),transparent 14%),
      radial-gradient(circle at 94% 94%,rgba(240,180,82,.17),transparent 13%);
  }
  html[data-theme="bluesky"] .sidebar, html[data-theme="bluesky"] .inspector{
    background:rgba(255,250,238,.97);
  }
  html[data-theme="bluesky"] .app{
    background:rgba(255,250,239,.94);
  }
  html[data-theme="bluesky"] .topbar, html[data-theme="bluesky"] .agent-strip{
    background:rgba(255,251,241,.96);
  }
  html[data-theme="bluesky"] .scroll{
    background:linear-gradient(180deg,rgba(255,252,244,.45),rgba(255,249,239,.72));
  }
}

/* ═══════════════════════════════════════════════════════════════
   v19 · 蓝天便利贴 reskin(按参考图)
   淡蓝天空壁纸 + 三栏便利贴卡片 + 粉色和纸胶带 + 按 Agent 固定气泡色
   + 发送者名字/时间在气泡上方 + 清晰系统字体正文。
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="bluesky"]{
  --font-readable:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif;
  --wall-light:url("chat-bluesky-v1.png");
  --wall-harbor:url("chat-bluesky-v1.png");
  --wall-default:var(--wall-light);
  --menu-wall-light:url("chat-bluesky-v1.png");
  --menu-wall-harbor:url("chat-bluesky-v1.png");
  --text:#2e3a48;
  --send-bg:#5b9fe8;
  --accent:#5b9fe8;
}

/* —— 全局:蓝天壁纸 + 清晰正文 —— */
html[data-theme="bluesky"] body{
  background:#cfeaf7 url("chat-bluesky-v1.png") center/cover fixed no-repeat;
  font-family:var(--font-readable);
  line-height:1.6;
}
html[data-theme="bluesky"] .wall{
  background-color:#cfeaf7;
  filter:none;
}
html[data-theme="bluesky"] .profile-page, html[data-theme="bluesky"] .menu-page{
  background-color:#cfeaf7;
  background-image:url("chat-bluesky-v1.png");
}
html[data-theme="bluesky"] .bubble, html[data-theme="bluesky"] .meta, html[data-theme="bluesky"] .agent-chip-model, html[data-theme="bluesky"] .agent-chip-name, html[data-theme="bluesky"] .session-item, html[data-theme="bluesky"] .side-room, html[data-theme="bluesky"] .side-sessions, html[data-theme="bluesky"] .side-foot-btn, html[data-theme="bluesky"] .insp-card, html[data-theme="bluesky"] .settings-card, html[data-theme="bluesky"] .composer textarea, html[data-theme="bluesky"] .day, html[data-theme="bluesky"] .insp-label, html[data-theme="bluesky"] .side-label{
  font-family:var(--font-readable);
}
html[data-theme="bluesky"] .bubble{ color:#2e3a48; font-size:clamp(14px,1.45vw,16px); line-height:1.6; }

/* —— 和纸胶带(粉色半透明条) —— */
html[data-theme="bluesky"] .sidebar::before, html[data-theme="bluesky"] .inspector::before, html[data-theme="bluesky"] .agent-strip::before, html[data-theme="bluesky"] .topbar::before{
  content:"";
  position:absolute;
  width:90px;
  height:26px;
  background:linear-gradient(180deg,rgba(242,139,168,.50),rgba(242,139,168,.38));
  background-image:repeating-linear-gradient(45deg,transparent 0 6px,rgba(255,255,255,.25) 6px 9px),linear-gradient(180deg,rgba(242,139,168,.50),rgba(242,139,168,.38));
  border-radius:3px;
  box-shadow:0 2px 6px rgba(90,120,150,.12);
  pointer-events:none;
}
html[data-theme="bluesky"] .sidebar::before{ left:26px; top:-11px; transform:rotate(-6deg); }
html[data-theme="bluesky"] .inspector::before{ right:28px; top:-11px; transform:rotate(4deg); }
html[data-theme="bluesky"] .agent-strip::before{ left:20px; top:-1px; width:64px; height:18px; transform:rotate(-6deg); z-index:2; }
html[data-theme="bluesky"] .topbar::before{ left:50%; top:2px; width:74px; height:20px; transform:translateX(-50%) rotate(-2deg); }

/* —— 桌面三栏便利贴 —— */
@media (min-width:1024px){
  html[data-theme="bluesky"] .wall{
    background:#cfeaf7 url("chat-bluesky-v1.png") center/cover fixed no-repeat !important;
    filter:none;
  }
  html[data-theme="bluesky"] .sidebar{
    background:#fffdf6;
    border:1px solid rgba(0,0,0,.05);
    border-radius:18px;
    box-shadow:0 8px 24px rgba(90,120,150,.15);
    transform:rotate(-0.6deg);
    overflow:visible;
  }
  html[data-theme="bluesky"] .app{
    background:rgba(255,253,246,.96);
    border:1px solid rgba(0,0,0,.05);
    border-radius:20px;
    box-shadow:0 8px 24px rgba(90,120,150,.15);
    transform:rotate(0deg);
  }
  html[data-theme="bluesky"] .agent-strip{
    background:#fffdf6;
    border:1px solid rgba(0,0,0,.05);
    border-radius:16px;
    box-shadow:0 8px 24px rgba(90,120,150,.15);
    background-image:radial-gradient(circle at 9px 50%,rgba(90,120,150,.16) 0 2.6px,transparent 3.1px);
    background-size:100% 22px;
    background-repeat:repeat-y;
    padding-left:24px;
  }
  html[data-theme="bluesky"] .scroll{ background:transparent; }
  html[data-theme="bluesky"] .topbar{ background:transparent; box-shadow:none; }
  /* 房间列表:选中淡蓝 + 左侧深蓝点缀 */
  html[data-theme="bluesky"] .side-room{ border:0; }
  html[data-theme="bluesky"] .side-room::before{
    content:"";
    position:absolute;
    left:2px; top:22%; bottom:22%;
    width:4px; border-radius:2px;
    background:transparent;
    font-size:0;
  }
  html[data-theme="bluesky"] .side-room.active{
    background:#d8ecfd;
    box-shadow:none;
    border:0;
  }
  html[data-theme="bluesky"] .side-room.active::before{ background:#5b9fe8; }
  html[data-theme="bluesky"] .side-sessions .session-item.active, html[data-theme="bluesky"] .side-sessions .session-item:hover{
    background:#d8ecfd;
    border-color:transparent;
  }
}
@media (min-width:1280px){
  html[data-theme="bluesky"] .inspector{
    background:#fffdf6;
    border:1px solid rgba(0,0,0,.05);
    border-radius:18px;
    box-shadow:0 8px 24px rgba(90,120,150,.15);
    transform:rotate(0.6deg);
  }
}
@media (max-width:1023.5px){
  html[data-theme="bluesky"] .inspector{ background:#cfeaf7 url("chat-bluesky-v1.png") center/cover no-repeat; }
}

/* —— 左栏品牌区 + 新建会话胶囊 —— */
html[data-theme="bluesky"] .side-brand-sub{
  display:flex; align-items:center; gap:6px;
  padding:0 8px 12px;
  font-size:12px; color:#58c48e;
  font-family:var(--font-readable);
}
html[data-theme="bluesky"] .side-online-dot{ width:8px; height:8px; border-radius:50%; background:#58c48e; box-shadow:0 0 0 3px rgba(88,196,142,.18); }
html[data-theme="bluesky"] .side-new-capsule{
  width:100%; border:0; border-radius:999px;
  background:#5b9fe8; color:#fff;
  padding:11px 12px; margin-bottom:6px;
  font:inherit; font-size:14px; font-weight:600; cursor:pointer;
  box-shadow:0 6px 14px rgba(91,159,232,.35);
  transition:transform .15s ease, box-shadow .2s ease;
}
html[data-theme="bluesky"] .side-new-capsule:hover{ transform:translateY(-1px); box-shadow:0 9px 18px rgba(91,159,232,.42); }
html[data-theme="bluesky"] .side-new-capsule:active{ transform:scale(.98); }
html[data-theme="bluesky"] .side-new-capsule:disabled{ opacity:.6; }

/* —— 气泡:按 Agent 固定底色 + 小尾巴 —— */
html[data-theme="bluesky"] .bubble{
  border:1px solid rgba(0,0,0,.05) !important;
  border-radius:16px;
  box-shadow:0 2px 8px rgba(90,120,150,.10) !important;
  letter-spacing:0;
}
html[data-theme="bluesky"] .row.ai.agent-codex:nth-of-type(n) .bubble, html[data-theme="bluesky"] .row.ai.agent-assistant:nth-of-type(n) .bubble{ background:#fffdf2; }
html[data-theme="bluesky"] .row.ai.agent-kimi:nth-of-type(n) .bubble{ background:#fff0ad; }
html[data-theme="bluesky"] .row.ai.agent-deepseek:nth-of-type(n) .bubble{ background:#d9edff; }
html[data-theme="bluesky"] .row.ai.agent-grok:nth-of-type(n) .bubble{ background:#ffe3ec; }
html[data-theme="bluesky"] .row.human:nth-of-type(n) .bubble{ background:#e3f4e4; }
html[data-theme="bluesky"] .row.ai.tail .bubble{ border-bottom-left-radius:16px; }
html[data-theme="bluesky"] .row.human.tail .bubble{ border-bottom-right-radius:16px; }
html[data-theme="bluesky"] .row.ai.tail .bubble::after{
  content:"";
  position:absolute; left:-5px; bottom:14px;
  width:10px; height:10px;
  background:inherit;
  transform:rotate(45deg);
  border-left:1px solid rgba(0,0,0,.05);
  border-bottom:1px solid rgba(0,0,0,.05);
  border-bottom-left-radius:3px;
}
html[data-theme="bluesky"] .row.human.tail .bubble::after{
  content:"";
  position:absolute; right:-5px; bottom:14px;
  width:10px; height:10px;
  background:inherit;
  transform:rotate(45deg);
  border-right:1px solid rgba(0,0,0,.05);
  border-top:1px solid rgba(0,0,0,.05);
  border-top-right-radius:3px;
}
html[data-theme="bluesky"] .bubble.att-only::after{ display:none; }

/* KK 的小太阳点缀 */
html[data-theme="bluesky"] .row.ai.agent-kimi .message-stack .meta .sender::before{ content:"☀️ "; }

/* —— 发送者名字 + 时间在气泡上方(灰蓝小字) —— */
html[data-theme="bluesky"] .message-stack .meta{
  color:#7a8ba0;
  font-size:12px;
  font-family:var(--font-readable);
}
html[data-theme="bluesky"] .message-stack .meta .sender{ color:#5b7b94; font-weight:600; }
html[data-theme="bluesky"] .message-stack .meta .time{ color:#7a8ba0; }

/* —— 正在输入:三个彩色跳点 —— */
html[data-theme="bluesky"] .typing-dots i:nth-child(1){ background:#5b9fe8; }
html[data-theme="bluesky"] .typing-dots i:nth-child(2){ background:#f5a94a; }
html[data-theme="bluesky"] .typing-dots i:nth-child(3){ background:#f28ba8; }

/* —— 附件卡片:白底圆角 —— */
html[data-theme="bluesky"] .att-file{
  background:#ffffff;
  border:1px solid rgba(0,0,0,.05);
  border-radius:14px;
  box-shadow:0 4px 12px rgba(90,120,150,.10);
}

/* —— 发送栏:白长条 + 蓝色圆形发送键(hover 放大) —— */
html[data-theme="bluesky"] .composer .field{
  background:#ffffff;
  border:1px solid rgba(0,0,0,.05);
  border-radius:999px;
  box-shadow:0 8px 24px rgba(90,120,150,.15);
}
html[data-theme="bluesky"] .floatbtn.send{
  background:#5b9fe8;
  border-radius:50%;
  box-shadow:0 8px 18px rgba(91,159,232,.38);
  transition:transform .18s var(--ease-soft), box-shadow .2s ease;
}
html[data-theme="bluesky"] .floatbtn.send:hover{ transform:scale(1.06); color:#fff; }

/* —— 施工面板:🔧 标题 + 每 Agent 彩色额度条 + 派发头像/绿✓ —— */
html[data-theme="bluesky"] .insp-head span::before{ content:"🔧 "; }
html[data-theme="bluesky"] .insp-quota-track{ background:rgba(90,120,150,.12); }
html[data-theme="bluesky"] .insp-quota-track.unknown{
  background:repeating-linear-gradient(135deg,rgba(90,120,150,.08) 0 5px,rgba(90,120,150,.14) 5px 9px);
}
html[data-theme="bluesky"] .insp-quota-track.unknown i{ width:0 !important; }
html[data-theme="bluesky"] .insp-quota-track i.q-codex{ background:#5b9fe8; }
html[data-theme="bluesky"] .insp-quota-track i.q-kimi{ background:#f5a94a; }
html[data-theme="bluesky"] .insp-quota-track i.q-deepseek{ background:#58c48e; }
html[data-theme="bluesky"] .insp-quota-track i.q-grok{ background:#f28ba8; }
html[data-theme="bluesky"] .insp-dp-head{ display:flex; align-items:center; gap:2px; }
html[data-theme="bluesky"] .insp-dp-ava{
  display:inline-block; width:16px; height:16px; flex:none;
  border-radius:50%; background-size:cover; background-position:center;
  margin-right:5px; border:1.5px solid #fff; box-shadow:0 2px 5px rgba(90,120,150,.18);
}
html[data-theme="bluesky"] .insp-ok{ color:#58c48e; font-weight:700; margin-left:3px; }

/* v27 · 输入栏始终服从左右边界，不再受旧版 760px 参考宽度限制。 */
html[data-theme="bluesky"] .composer{
  width:auto;
  max-width:none;
  margin-left:0;
  margin-right:0;
}

/* Mac 分屏或较窄桌面窗口仍使用一整条宽输入栏。 */
@media (min-width:700px) and (max-width:1023.5px){
  html[data-theme="bluesky"] .composer{
    left:24px;
    right:24px;
    min-height:78px;
    padding:9px 12px;
    border:1px solid rgba(113,89,65,.13);
    border-radius:17px 20px 18px 16px;
    background:rgba(255,252,245,.98);
    box-shadow:0 8px 20px rgba(77,103,119,.13);
  }
  html[data-theme="bluesky"] .composer .field{ min-height:60px; }
  html[data-theme="bluesky"] .composer .floatbtn.send{ width:58px; height:58px; }
}

/* —— 大标题字体:快乐体仅限标题,正文一律系统字体 —— */
html[data-theme="bluesky"] .login h1, html[data-theme="bluesky"] .menu-title, html[data-theme="bluesky"] .peerpill .name, html[data-theme="bluesky"] .side-brand, html[data-theme="bluesky"] .insp-head, html[data-theme="bluesky"] .profile-topbar h2, html[data-theme="bluesky"] .settings-intro h3{
  font-family:var(--font-hand);
}

/* ═══ v30 · 多选删除 / 会话删除 ═══ */
.select-mode .composer{ opacity:.4; pointer-events:none; }
.select-mode .row{ cursor:pointer; }
.select-mode .message-stack{ position:relative; }
.select-mode .message-stack::before{
  content:"";
  position:absolute;
  left:-30px; top:22px;
  width:18px; height:18px;
  border-radius:50%;
  border:2px solid rgba(90,120,150,.35);
  background:#fff;
  z-index:2;
}
.select-mode .row.human .message-stack::before{ left:-30px; }
.select-mode .row.select-picked .message-stack::before{
  background:#5b9fe8;
  border-color:#5b9fe8;
  box-shadow:inset 0 0 0 3px #fff;
}
.row.select-picked .bubble{
  background:#d8ecfd !important;
  outline:2px solid rgba(91,159,232,.45);
  outline-offset:1px;
}
.select-bar{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom: calc(var(--composer-zone) + 10px);
  z-index:150;
  display:flex; align-items:center; gap:10px;
  background:#fffdf6;
  border:1px solid rgba(0,0,0,.05);
  border-radius:999px;
  padding:8px 10px 8px 16px;
  box-shadow:0 8px 24px rgba(90,120,150,.18);
  font-size:13px; color:#2e3a48;
  white-space:nowrap;
}
.select-bar[hidden]{ display:none; }
.select-count{ font-weight:600; margin-right:2px; }
.select-act{
  border:0; border-radius:999px; padding:7px 13px;
  background:rgba(91,159,232,.12); color:#3d6f9e;
  font:inherit; font-size:13px; cursor:pointer;
}
.select-act.danger{ background:rgba(224,90,77,.12); color:#c0533f; }
.select-act:disabled{ opacity:.45; cursor:default; }
.select-act:active:not(:disabled){ transform:scale(.96); }
@media (min-width:1024px){
  .select-bar{ left:calc(50% + 132px); }
}
@media (min-width:1280px){
  .select-bar{ left:calc(50% + 132px - 140px); }
}

/* 会话项删除按钮 */
.session-del{
  border:0; background:transparent; color:var(--text-faint);
  width:28px; height:28px; border-radius:50%;
  display:grid; place-items:center; cursor:pointer; padding:0; font-size:13px;
}
.session-del:hover{ color:#c0533f; background:var(--seg-track); }
@media (min-width:1024px){
  .session-del{ opacity:0; transition:opacity .15s ease; }
  .session-item:hover .session-del{ opacity:1; }
}
