body {
        margin: 0;
        background: #0a0e27;
        /* v160：字型可以換（--tt-font-family 由「顯示與提示音設定」的字型設定；沒設定就是原本的思源黑體） */
        font-family: var(--tt-font-family, 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
        min-height: 100vh;
        overflow-x: hidden;
        color: #f1f5f9;
        transition: background 0.4s ease;
    }

    /* === 漸層背景 + 漂浮光暈 === */
    .app-bg {
        position: fixed; inset: 0;
        background:
            radial-gradient(ellipse at top left, #1e1b4b 0%, transparent 50%),
            radial-gradient(ellipse at bottom right, #2e1065 0%, transparent 50%),
            linear-gradient(135deg, #0a0e27 0%, #131838 100%);
        z-index: -2;
    }
    .orb {
        position: fixed; border-radius: 50%;
        filter: blur(90px); opacity: 0.5;
        z-index: -1; pointer-events: none;
        animation: float 22s ease-in-out infinite;
        transition: opacity 0.6s ease;
    }
    .orb-1 { width: 420px; height: 420px;
        background: radial-gradient(circle, #6366f1, transparent 70%);
        top: -120px; left: -120px; }
    .orb-2 { width: 520px; height: 520px;
        background: radial-gradient(circle, #ec4899, transparent 70%);
        bottom: -180px; right: -180px; animation-delay: -8s; }
    .orb-3 { width: 320px; height: 320px;
        background: radial-gradient(circle, #06b6d4, transparent 70%);
        top: 40%; left: 45%; animation-delay: -15s; opacity: 0.35; }
    @keyframes float {
        0%,100% { transform: translate(0,0) scale(1); }
        33%     { transform: translate(60px,-40px) scale(1.1); }
        66%     { transform: translate(-40px,50px) scale(0.95); }
    }

    /* === 品牌署名 === */
    /* v130：左上角的標誌和三個英文小字拿掉，改成 ThreeTalk 標題下方的「by 🤔 ThinkingFace AI」（方案 B 署名細線）。 */
    .brand-byline {
        display: flex; justify-content: center; align-items: center; gap: 0.55rem;
        margin: 0.45rem auto 1.1rem; color: #94a3b8; font-size: 0.95rem; letter-spacing: 0.08em; line-height: 1.2;
    }
    .brand-byline .line { width: 3rem; height: 1px; background: linear-gradient(90deg, transparent, rgba(196,181,253,0.7)); }
    .brand-byline .line.r { background: linear-gradient(90deg, rgba(196,181,253,0.7), transparent); }
    .brand-byline .by { font-style: italic; }
    .brand-byline .emoji { font-size: 1.1rem; letter-spacing: 0; }
    .brand-byline .name { color: #e2e8f0; font-weight: 700; letter-spacing: 0.05em; }
    .product-subtitle.with-byline { margin-bottom: 0.2rem; }

    /* === 沉浸模式：頂部極簡 Bar === */
    .compact-bar {
        display: none;
        position: fixed; top: 0; left: 0; right: 0;
        z-index: 100;
        padding: 0.7rem 1.2rem;
        background: rgba(10, 14, 39, 0.75);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255,255,255,0.06);
        align-items: center; justify-content: space-between;
        animation: slideDown 0.35s ease;
    }
    @keyframes slideDown {
        from { transform: translateY(-100%); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }
    .compact-bar .left-side {
        display: inline-flex; align-items: center; gap: 0.5rem;
        font-size: 1rem; font-weight: 700;
    }
    .compact-bar .logo-emoji { font-size: 1.2rem; }
    .compact-bar .logo-text {
        background: linear-gradient(135deg, #fbbf24 0%, #f472b6 50%, #a78bfa 100%);
        -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    .compact-bar .status-pill-mini {
        display: inline-flex; align-items: center; gap: 0.4rem;
        font-size: 0.78rem; color: #cbd5e1;
        padding: 0.3rem 0.8rem;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 999px;
    }
    .compact-bar .status-pill-mini .dot {
        width: 7px; height: 7px; border-radius: 50%;
        background: #34d399; box-shadow: 0 0 10px #34d399;
        animation: pulse 2s ease-in-out infinite;
    }
    /* 對方暫時離開時，狀態燈改成琥珀色。 */
    .compact-bar .status-pill-mini.away .dot { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }

    body.in-chat .brand-footer,
    body.in-chat .lobby-decoration { display: none !important; }
    body.in-chat .compact-bar { display: flex !important; }
    /* 聊天時光暈幾乎看不到，停止動畫，避免整個畫面的模糊效果每一幀都要重算。 */
    body.in-chat .orb { opacity: 0.15; animation-play-state: paused; }
    body.in-chat .nicegui-content { padding: 0 !important; }

    /* 聊天視窗分配剩餘高度，避免快捷列/回覆預覽把輸入框擠出螢幕。 */
    body.in-chat { overflow: hidden; }
    body.in-chat .chat-main-area {
        height: 100vh;
        height: 100dvh;
        padding: calc(4.5rem + env(safe-area-inset-top, 0px)) 0.75rem max(0.5rem, env(safe-area-inset-bottom, 0px)) !important;
        gap: 0.5rem;
        max-width: 1200px !important;
        width: 100% !important;
        margin: 0 auto;
    }
    body.in-chat .chat-wrapper { flex: 1 1 0; min-height: 80px; }
    body.in-chat .chat-window {
        height: 100% !important;
        border-radius: 24px !important;
    }
    body.in-chat .match-actions { display: none !important; }
    .message-input-area { flex-wrap: nowrap; }
    .message-input-area .q-field { min-width: 0; }

    /* === 產品主標 === */
    .product-title {
        font-size: 5.4rem; font-weight: 900; line-height: 1; text-align: center;
        background: linear-gradient(135deg, #60a5fa 0%, #c084fc 45%, #f472b6 90%);
        -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        background-clip: text;
        margin: 0.5rem 0 0.25rem; letter-spacing: -0.045em;
    }
    .product-title-sm { font-size: 3.6rem; }
    /* h1 / h2 會帶 Quasar 的字級與行高，這裡全部明確覆寫。 */
    .product-heading {
        margin: 0; padding: 0; text-align: center;
        font-size: inherit; font-weight: inherit; line-height: normal; letter-spacing: normal;
    }
    .product-heading .product-title { display: block; }
    .product-h1-sub {
        display: block; margin: 0.35rem 0 0.4rem;
        color: #c4b5fd; font-size: 1.05rem; font-weight: 700;
        letter-spacing: 0.32em; line-height: 1.5;
    }
    .product-subtitle {
        color: #cbd5e1; font-size: 1.05rem; text-align: center;
        margin: 0 0 1.5rem; font-weight: 400;
    }
    .guide-link {
        display: inline-block; margin: 1.4rem 0 0.4rem;
        color: #a5b4fc; font-size: 0.85rem; text-decoration: none;
        border-bottom: 1px dashed rgba(165,180,252,0.45); padding-bottom: 2px;
    }
    .guide-link:hover { color: #e0e7ff; border-bottom-color: #e0e7ff; }
    .three-pillars {
        display: flex; justify-content: center; gap: 1.5rem;
        margin: 1rem 0 2rem; flex-wrap: wrap;
    }
    .pillar {
        display: inline-flex; align-items: center; gap: 0.4rem;
        color: #cbd5e1; font-size: 0.85rem; letter-spacing: 0.1em;
    }
    .pillar .num {
        background: linear-gradient(135deg, #6366f1, #a78bfa);
        -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        font-weight: 800; font-size: 1.1rem;
    }

    /* === 步驟區塊 === */
    .step-section {
        width: 100%; max-width: 640px; margin: 0 auto 1.5rem;
        padding: 1.2rem; border-radius: 20px;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(255,255,255,0.06);
        backdrop-filter: blur(10px);
    }
    .step-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
    .step-num {
        width: 28px; height: 28px; border-radius: 50%;
        background: linear-gradient(135deg, #6366f1, #a78bfa);
        color: white; font-weight: 700; font-size: 0.85rem;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .step-title { font-size: 1.05rem; font-weight: 700; color: #f1f5f9; margin: 0; line-height: 1.5; letter-spacing: normal; }
    .step-subtitle { color: #94a3b8; font-size: 0.8rem; margin-left: 2.2rem; margin-bottom: 1rem; }

    /* === 頭貼卡片 === */
    .avatar-card {
        background: rgba(255,255,255,0.05) !important;
        backdrop-filter: blur(12px);
        border: 2px solid rgba(255,255,255,0.08) !important;
        border-radius: 20px !important; padding: 12px !important;
        cursor: pointer !important; box-shadow: none !important;
        transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }
    .avatar-card:hover {
        background: rgba(255,255,255,0.10) !important;
        border-color: rgba(168,139,250,0.5) !important;
        transform: translateY(-4px) scale(1.04);
    }
    .avatar-card.selected {
        background: rgba(168,139,250,0.18) !important;
        border-color: #a78bfa !important;
        box-shadow: 0 12px 32px rgba(168,139,250,0.4) !important;
        transform: translateY(-4px) scale(1.06);
    }
    .avatar-card:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 4px; }
    .avatar-tabs { color: #cbd5e1; margin-bottom: 0.75rem; }
    .avatar-tabs .q-tab { min-width: 0; padding: 0 0.8rem; }
    /* v98：把圖片拖進聊天室時的提示；不擋滑鼠，放開的位置照樣由網頁接收。 */
    .photo-drop-overlay { position: fixed; inset: 0; z-index: 7000; display: none; align-items: center; justify-content: center;
        background: rgba(10, 14, 40, 0.72); pointer-events: none; }
    .photo-drop-overlay.show { display: flex; }
    .photo-drop-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 36px; max-width: 86vw;
        border: 3px dashed #a5b4fc; border-radius: 24px; background: rgba(30, 36, 80, 0.9); color: #fff; font-size: 1.15rem; font-weight: 700; }
    .photo-drop-icon { font-size: 2.4rem; line-height: 1; }
    .photo-drop-box small { font-size: 0.85rem; font-weight: 500; color: #c7d2fe; }
    /* v87：頭貼有七類（v133 起八類，v157 起十二類）。分頁排不下一行時換到下一行，不用左右滑也能看到全部分類。 */
    .avatar-tabs .q-tabs__content { flex-wrap: wrap; justify-content: center; }
    .avatar-tabs .q-tabs__content .q-tab { flex: 0 0 auto; }
    .avatar-tabs .q-tabs__arrow { display: none; }
    .avatar-panels { background: transparent !important; overflow: visible; }
    .avatar-panel { padding: 0.75rem 0.35rem !important; }
    .avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; width: 100%; }
    .avatar-card { align-items: center; width: 100%; gap: 8px; }
    .avatar-picture { width: 88px; height: 88px; max-width: 100%; border-radius: 20px; }
    .avatar-name { color: #e2e8f0; font-size: 0.78rem; text-align: center; line-height: 1.4; overflow-wrap: anywhere; }
    .avatar-selection { color: #c4b5fd; font-size: 0.8rem; text-align: center; margin-top: 0.5rem; }
    @media (max-width: 560px) {
        .avatar-tabs .q-tab { padding: 0 0.5rem; }
        .avatar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
        .avatar-card { padding: 10px 5px !important; gap: 7px; }
        .avatar-picture { width: 72px; height: auto; aspect-ratio: 1; border-radius: 16px; }
        .avatar-name { font-size: 0.72rem; }
    }

    /* === 顏色卡片 === */
    .color-card {
        cursor: pointer; padding: 0.8rem;
        border-radius: 16px;
        background: rgba(255,255,255,0.04);
        border: 2px solid rgba(255,255,255,0.08);
        text-align: center; min-width: 88px;
        transition: all 0.25s ease;
        display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    }
    .color-card:hover {
        background: rgba(255,255,255,0.08);
        transform: translateY(-3px);
    }
    .color-card.selected {
        border-color: var(--c, #fff);
        box-shadow: 0 0 0 4px rgba(255,255,255,0.08), 0 8px 20px rgba(0,0,0,0.3);
        transform: translateY(-3px);
    }
    .color-swatch {
        width: 36px; height: 36px; border-radius: 50%;
        box-shadow: 0 0 12px var(--c, #fff), inset 0 -6px 12px rgba(0,0,0,0.15);
    }
    .color-name { font-size: 0.8rem; font-weight: 600; }

    /* === 模式切換卡片 === */
    /* v124：兩個方框並排、一樣高（NiceGUI 的 row 預設靠上對齊又會換行，這裡改成撐滿、不換行）。 */
    .nicegui-row.mode-row { flex-wrap: nowrap; align-items: stretch; justify-content: center; gap: 0.75rem; }
    .mode-card {
        flex: 1; min-width: 200px; max-width: 260px;
        padding: 1.3rem 1rem; border-radius: 18px;
        background: rgba(255,255,255,0.04);
        border: 2px solid rgba(255,255,255,0.08);
        cursor: pointer; text-align: center;
        transition: all 0.3s ease;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
    }
    /* v124：只有滑鼠才有浮起效果；手機點過後不會一直停在上移 3px 的樣子，兩個方框保持對齊。 */
    @media (hover: hover) and (pointer: fine) {
        .mode-card:hover { background: rgba(255,255,255,0.08); transform: translateY(-3px); }
    }
    .mode-card.selected {
        background: linear-gradient(135deg, rgba(99,102,241,0.18) 0%, rgba(168,139,250,0.18) 100%);
        border-color: #a78bfa;
        box-shadow: 0 12px 30px rgba(168,139,250,0.3);
    }
    .mode-card.disabled { opacity: 0.5; cursor: not-allowed; }
    .mode-icon { font-size: 1.6rem; margin-bottom: 0.4rem; letter-spacing: -0.1em; white-space: nowrap; line-height: 1.3; }
    .mode-name { font-size: 1.05rem; font-weight: 700; color: #f1f5f9; margin-bottom: 0.2rem; }
    .mode-desc { font-size: 0.75rem; color: #94a3b8; line-height: 1.4; }

    /* === 線上人數膠囊 === */
    .status-pill {
        display: inline-flex; align-items: center; gap: 0 0.65rem;
        padding: 0.22rem 0.8rem;
        background: rgba(16,185,129,0.08);
        border: 1px solid rgba(16,185,129,0.25);
        border-radius: 999px;
        backdrop-filter: blur(12px);
        color: #d1fae5; font-size: 0.82rem; font-weight: 500;
        flex-wrap: wrap; justify-content: center;
    }
    .status-pill .dot {
        display: inline-block;
        width: 8px; height: 8px; border-radius: 50%;
        background: #10b981; box-shadow: 0 0 14px #10b981;
        animation: pulse 2s ease-in-out infinite;
    }
    .status-pill .count-item { display: inline-flex; align-items: center; gap: 0.26rem; white-space: nowrap; }
    .status-pill strong { color: #34d399; font-weight: 700; }
    /* v142：方案 A「分段膠囊」。三段一樣高（44px，手指好按），中間用細線分隔；
       「1對1 等待」沒有外框，只用「›」和虛線底線提示可以點，滑鼠移上去或按下時整段亮起來。
       v143：「三人聊 等待」也是一樣的按鈕，兩顆共用 .queue-trigger。 */
    .status-pill.segmented { gap: 0; padding: 0 6px; min-height: 44px; flex-wrap: nowrap; }
    .status-pill.segmented .count-item { position: relative; min-height: 44px; padding: 0 14px; gap: 0.3rem; }
    .status-pill.segmented .count-item + .count-item::before {
        content: ''; position: absolute; left: 0; top: 13px; bottom: 13px; width: 1px;
        background: rgba(52,211,153,0.3); pointer-events: none;
    }
    .status-pill .count-value { display: inline-flex; align-items: baseline; gap: 0.2rem; }
    .queue-trigger {
        margin: 0; padding: 0 10px 0 14px; border: 0; border-radius: 999px;
        color: inherit; font: inherit; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease;
    }
    .queue-trigger .count-label { text-decoration: underline dotted rgba(209,250,229,0.6); text-underline-offset: 4px; }
    .queue-trigger .q-icon.count-more { color: inherit; font-size: 1.1rem; opacity: 0.85; margin-left: -2px; }
    @media (hover: hover) { .queue-trigger:hover { background: rgba(16,185,129,0.2); } }
    .queue-trigger:active { background: rgba(16,185,129,0.26); }
    .queue-trigger:focus-visible { outline: 2px solid #6ee7b7; outline-offset: -3px; }
    @media (max-width: 560px) {
        /* 手機：三欄，上面標籤、下面數字；「›」靠在那一欄的右邊，三段永遠排在同一行。 */
        .status-pill.segmented { width: 100%; max-width: 380px; padding: 4px; border-radius: 18px; justify-content: space-between; }
        .status-pill.segmented .count-item {
            flex: 1 1 0; min-width: 0; min-height: 52px; padding: 4px 6px;
            flex-direction: column; justify-content: center; gap: 1px;
        }
        .status-pill.segmented .count-item + .count-item::before { top: 12px; bottom: 12px; }
        .status-pill.segmented .count-label { font-size: 0.72rem; color: #a7f3d0; }
        .status-pill.segmented strong { font-size: 1.12rem; }
        .status-pill.segmented .dot { position: absolute; left: 10px; top: 12px; width: 7px; height: 7px; }
        .status-pill.segmented .queue-trigger { border-radius: 14px; }
        /* v143：「›」放在數字那一行的右邊；「三人聊 等待」的標籤比較長，放在中間高度會碰到標籤。 */
        .status-pill.segmented .queue-trigger .q-icon.count-more {
            position: absolute; right: 3px; top: auto; bottom: 10px; margin: 0; transform: none;
        }
    }
    @media (max-width: 360px) {
        .status-pill.segmented .count-label { font-size: 0.68rem; }
        .status-pill.segmented .dot { left: 6px; }
        .status-pill.segmented .queue-trigger .q-icon.count-more { right: 1px; font-size: 0.95rem; }
    }
    .pair-queue-details .pair-queue-counts { display: grid; gap: 0.5rem; width: 100%; }
    .pair-queue-details .pair-queue-row {
        display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
        padding: 0.6rem 0.8rem; border: 1px solid rgba(148,163,184,0.33);
        border-radius: 0.65rem;
    }
    .pair-queue-details .pair-queue-number { font-weight: 700; font-variant-numeric: tabular-nums; }
    .pair-queue-cooldown-times {
        width: 100%; max-height: 8rem; overflow-y: auto; overscroll-behavior: contain;
        margin: 0; padding: 0 0.8rem; list-style: none; font-variant-numeric: tabular-nums;
        border: 1px solid rgba(148,163,184,0.33); border-radius: 0.65rem;
    }
    .pair-queue-cooldown-times li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0; }
    .pair-queue-cooldown-times li + li { border-top: 1px solid rgba(148,163,184,0.22); }
    .pair-queue-cooldown-times li span:last-child { white-space: nowrap; }
    .pair-queue-cooldown-times:focus-visible { outline: 2px solid currentColor; }
    /* v99：線上的人的頭貼 */
    .online-avatars-wrap { display: flex; justify-content: center; }
    .online-avatars {
        display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
        gap: 6px; max-width: 26rem; margin: 0.15rem auto 0; padding: 0 0.25rem;
    }
    .online-avatars-items { display: contents; }   /* v100：收合時頭貼和「+N」排在同一串 */
    .online-avatars img {
        width: 30px; height: 30px; border-radius: 50%; display: block; object-fit: cover;
        background: rgba(255,255,255,0.9); box-shadow: 0 0 0 2px rgba(16,185,129,0.45);   /* v156：開關關著時和以前一樣 */
        user-select: none; -webkit-user-drag: none;
    }
    .online-avatars .online-more {
        min-width: 30px; height: 30px; padding: 0 0.45rem; border-radius: 999px;
        display: inline-flex; align-items: center; justify-content: center;
        background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.35);
        color: #a7f3d0; font-size: 0.75rem; font-weight: 700;
        font-family: inherit; line-height: 1; margin: 0;
    }
    /* v100：「+N」可以點，展開全部；展開後超過約 6 行就在框內捲動，「收合」固定在框下面 */
    .online-avatars button.online-more { cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .online-avatars button.online-more:hover { background: rgba(16,185,129,0.24); color: #ecfdf5; }
    .online-avatars button.online-more:focus-visible { outline: 2px solid #6ee7b7; outline-offset: 2px; }
    .online-avatars.expanded { flex-direction: column; flex-wrap: nowrap; gap: 0.4rem; width: 100%; }
    .online-avatars.expanded .online-avatars-items {
        display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px;
        width: 100%; max-height: 13.6rem; overflow-y: auto; overscroll-behavior: contain;
        padding: 3px 2px; scrollbar-width: thin; scrollbar-color: rgba(16,185,129,0.45) transparent;
    }
    .online-avatars .online-rest { color: #a7f3d0; font-size: 0.75rem; padding: 0 0.3rem; }
    .online-avatars.expanded button.online-more { padding: 0 0.9rem; }
    /* v155：聊了 10 分鐘以上的人：頭貼外圍一圈會轉的光環（10、15 分鐘青綠色，20、25 分鐘橘色，30、60 分鐘紅色），
       聊越久轉越快、紅色的光暈一閃一閃。點一下頭貼輕輕跳一下，上方冒出「已經聊了 N 分鐘」的小對話框。
       光環畫在頭貼外面 3px，排版大小和一般頭貼一樣是 30px，兩個相鄰的光環剛好碰到、不會疊在一起。
       v156：只有打開「顯示聊天時間光環」的人才看得到（伺服器只對他們送光環版的頭貼列）。 */
    .online-avatars.chat-rings-on img { box-shadow: 0 0 0 2px rgba(203,213,225,0.30); }   /* 打開時一般頭貼外框改淡灰色 */
    .online-chat.tier-teal, .chat-ring-pop.tier-teal { --tier: #2dd4bf; --tier-light: #99f6e4; --tier-rgb: 45,212,191; }
    .online-chat.tier-orange, .chat-ring-pop.tier-orange { --tier: #fb923c; --tier-light: #fdba74; --tier-rgb: 251,146,60; }
    .online-chat.tier-red, .chat-ring-pop.tier-red { --tier: #f43f5e; --tier-light: #fda4af; --tier-rgb: 244,63,94; }
    .online-avatars .online-chat {
        appearance: none; -webkit-appearance: none; border: 0; padding: 0; margin: 0; background: none; color: inherit;
        position: relative; display: block; flex: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
        font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    }
    .online-avatars .online-chat:focus-visible { outline: 2px solid #f8fafc; outline-offset: 5px; }
    .online-avatars .online-chat::before {
        content: ""; position: absolute; inset: -3px; border-radius: 50%; z-index: 0;
        background: conic-gradient(from 0deg, var(--tier), var(--tier-light), var(--tier), var(--tier-light), var(--tier));
        animation: chat-ring-spin var(--spin, 3s) linear infinite;
    }
    .online-avatars .online-chat::after {
        content: ""; position: absolute; inset: -3px; border-radius: 50%; z-index: 0; pointer-events: none;
        box-shadow: 0 0 8px 1px rgba(var(--tier-rgb), 0.55);
        animation: chat-ring-glow 2.4s ease-in-out infinite;
    }
    .online-avatars .online-chat.tier-red::after { animation-duration: 1.1s; }
    .online-avatars .online-chat img { position: relative; z-index: 1; box-shadow: 0 0 0 1px #0b1220; }
    .online-avatars .online-chat.tap img { animation: chat-ring-hop 0.45s ease-out; }
    .online-avatars .online-chat[data-minutes="10"] { --spin: 3.6s; }
    .online-avatars .online-chat[data-minutes="15"] { --spin: 3s; }
    .online-avatars .online-chat[data-minutes="20"] { --spin: 2.6s; }
    .online-avatars .online-chat[data-minutes="25"] { --spin: 2.2s; }
    .online-avatars .online-chat[data-minutes="30"] { --spin: 1.8s; }
    .online-avatars .online-chat[data-minutes="60"] { --spin: 1.3s; }
    .online-avatars.expanded .online-avatars-items { padding: 8px 6px; }   /* 展開捲動時，最上、最下一排的光環和光暈不被切掉 */
    @keyframes chat-ring-spin { to { transform: rotate(360deg); } }
    @keyframes chat-ring-glow { 0%, 100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
    @keyframes chat-ring-hop {
        0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-5px) scale(1.08); }
        70% { transform: translateY(1px) scale(0.97); } 100% { transform: translateY(0) scale(1); }
    }
    .chat-ring-pop {
        position: fixed; left: 0; top: 0; z-index: 9000; pointer-events: none; white-space: nowrap;
        padding: 6px 12px; border-radius: 12px; background: rgba(15,23,42,0.96); color: #f8fafc;
        font-size: 13px; font-weight: 700; line-height: 1.35; letter-spacing: 0.02em;
        border: 1.5px solid var(--tier); box-shadow: 0 8px 20px rgba(0,0,0,0.45), 0 0 12px rgba(var(--tier-rgb), 0.35);
        transform-origin: var(--arrow-x, 50%) 100%; animation: chat-ring-pop-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1) both;
    }
    .chat-ring-pop.below { transform-origin: var(--arrow-x, 50%) 0; }
    .chat-ring-pop .crp-dot {
        display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tier);
        margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 6px var(--tier);
    }
    .chat-ring-pop::after {
        content: ""; position: absolute; left: var(--arrow-x, 50%); bottom: -6px; width: 10px; height: 10px;
        background: rgb(15,23,42); border-right: 1.5px solid var(--tier); border-bottom: 1.5px solid var(--tier);
        transform: translateX(-50%) rotate(45deg);
    }
    .chat-ring-pop.below::after {
        bottom: auto; top: -6px; border: 0; border-left: 1.5px solid var(--tier); border-top: 1.5px solid var(--tier);
    }
    @keyframes chat-ring-pop-in { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
    /* v156：「狀態：閒置中」上方的開關「顯示聊天時間光環」：關著是灰色，打開時軌道是三種光環顏色。 */
    .chat-rings-setting { display: flex; justify-content: center; margin: 0.45rem 0 0.15rem; }
    .chat-rings-switch {
        display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 5px 14px 5px 8px; border-radius: 999px;
        cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 600; color: #cbd5e1;
        background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
        -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    }
    .chat-rings-switch:hover { background: rgba(255,255,255,0.09); }
    .chat-rings-switch:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
    .chat-rings-switch .crs-track {
        position: relative; display: block; flex: none; width: 34px; height: 20px; border-radius: 999px;
        background: rgba(148,163,184,0.38); transition: background 0.2s;
    }
    .chat-rings-switch .crs-knob {
        position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
        background: #f8fafc; box-shadow: 0 1px 3px rgba(0,0,0,0.45); transition: transform 0.2s;
    }
    .chat-rings-switch[aria-checked="true"] { color: #ccfbf1; background: rgba(45,212,191,0.10); border-color: rgba(45,212,191,0.45); }
    .chat-rings-switch[aria-checked="true"] .crs-track { background: linear-gradient(90deg, #2dd4bf, #fb923c, #f43f5e); }
    .chat-rings-switch[aria-checked="true"] .crs-knob { transform: translateX(14px); }
    @media (prefers-reduced-motion: reduce) { .chat-rings-switch .crs-track, .chat-rings-switch .crs-knob { transition: none; } }
    @media (prefers-reduced-motion: reduce) {   /* 系統設定減少動態效果：光環不轉、不閃，點了也不跳 */
        .online-avatars .online-chat::before, .online-avatars .online-chat::after,
        .online-avatars .online-chat img, .chat-ring-pop { animation: none !important; }
    }
    @keyframes pulse {
        0%,100% { opacity: 1; transform: scale(1); }
        50%     { opacity: 0.55; transform: scale(1.3); }
    }

    /* === 狀態橫幅 === */
    .state-banner {
        display: inline-flex; align-items: center; gap: 0.5rem;
        padding: 0.5rem 1.2rem;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 999px;
        color: #cbd5e1; font-size: 0.9rem; margin: 0.8rem 0;
    }
    .matching-dots { display: inline-flex; gap: 5px; margin-left: 4px; }
    .matching-dots span {
        width: 7px; height: 7px; background: #a78bfa; border-radius: 50%;
        animation: bounce 1.4s infinite ease-in-out both;
    }
    .matching-dots span:nth-child(1) { animation-delay: -0.32s; }
    .matching-dots span:nth-child(2) { animation-delay: -0.16s; }
    @keyframes bounce {
        0%,80%,100% { transform: scale(0.4); opacity: 0.5; }
        40%         { transform: scale(1.0); opacity: 1; }
    }

    /* === 聊天視窗 === */
    .chat-window {
        background: rgba(15,23,42,0.55) !important;
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255,255,255,0.08) !important;
        border-radius: 22px !important;
        box-shadow: 0 20px 60px rgba(0,0,0,0.4);
        height: 65vh !important;
        position: relative;
    }

    .msg-row { display: flex; gap: 0.6rem; margin: 0.6rem 0; align-items: flex-end; width: 100%; }
    .msg-row.msg-me { flex-direction: row-reverse; }
    .msg-avatar {
        width: 38px; height: 38px; border-radius: 50%;
        background: rgba(255,255,255,0.08);
        flex-shrink: 0; padding: 2px;
    }
    .msg-content { display: flex; flex-direction: column; max-width: 70%; }
    .msg-row.msg-me .msg-content { align-items: flex-end; }
    /* 收到的文字、照片和貼圖氣泡依內容寬度排列。 */
    .msg-partner .msg-bubble-fit { align-self: flex-start; max-width: 100%; }
    .msg-name {
        font-size: 0.72rem;
        margin-bottom: 0.25rem; padding: 0 0.5rem;
        font-weight: 600;
    }
    /* 連續訊息隱藏重複身分，但保留頭像欄寬，讓泡泡及操作列維持對齊。 */
    .msg-continuation .msg-name { display: none; }
    .msg-continuation .msg-avatar { visibility: hidden; height: 0; padding-top: 0; padding-bottom: 0; }
    /* v73：頭像是按鈕，點了看那個人的狀態與興趣。外觀和原本的頭像一樣。 */
    .msg-avatar-btn {
        appearance: none; -webkit-appearance: none; border: 0; margin: 0; padding: 0; background: none;
        border-radius: 50%; flex-shrink: 0; line-height: 0; cursor: pointer; touch-action: manipulation;
    }
    .msg-avatar-btn:hover .msg-avatar { box-shadow: 0 0 0 2px rgba(196,181,253,0.55); }
    .msg-avatar-btn:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    .msg-continuation .msg-avatar-btn { visibility: hidden; height: 0; pointer-events: none; }
    body.in-chat .msg-continuation .msg-row { margin-top: 1px; }
    .msg-bubble {
        padding: 0.6rem 0.95rem; border-radius: 16px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.08);
        font-size: 0.95rem; line-height: 1.5;
        word-break: break-word; white-space: pre-wrap;
        animation: msgIn 0.3s ease;
    }
    @keyframes msgIn {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .msg-bubble.msg-bubble-me {
        background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(168,139,250,0.25) 100%);
        border-color: rgba(168,139,250,0.3);
    }
    /* v44 已讀：顯示在自己泡泡的左下角（LINE 的位置）。只改外層 class，不重畫訊息內容，播放中的語音不會中斷。 */
    .msg-read .msg-bubble-me { position: relative; }
    .msg-read .msg-bubble-me::before {
        content: '已讀'; position: absolute; right: calc(100% + 6px); bottom: calc(3px + 0.82rem);
        color: #94a3b8; font-size: 0.68rem; font-weight: 500; line-height: 1.2;
        white-space: nowrap; pointer-events: none;
    }
    .msg-read-1 .msg-bubble-me::before { content: '已讀 1'; }
    .msg-read-2 .msg-bubble-me::before { content: '已讀 2'; }
    /* 泡泡旁固定留出「下午 12:09」的寬度：長訊息的時間與已讀不會被切掉，已讀出現時也不會重新排版。 */
    .msg-row.msg-me .msg-content, .msg-row.msg-partner .msg-content { max-width: min(70%, calc(100% - 112px)); }
    body.in-chat .msg-row.msg-me .msg-content, body.in-chat .msg-row.msg-partner .msg-content { max-width: min(82%, calc(100% - 112px)); }
    /* v60：LINE 樣式的時間（台灣時間，由伺服器寫在 data-time）。自己的訊息在泡泡左下、已讀疊在時間上方；對方的訊息在泡泡右下。 */
    .msg-bubble[data-time] { position: relative; }
    .msg-bubble[data-time]::after {
        content: attr(data-time); position: absolute; left: calc(100% + 6px); bottom: 1px;
        color: #94a3b8; font-size: 0.66rem; font-weight: 500; line-height: 1.2;
        white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums;
    }
    .msg-bubble-me[data-time]::after { left: auto; right: calc(100% + 6px); }
    /* v60：貼圖訊息不加泡泡底色，圖片本身就是內容。 */
    .msg-bubble.msg-sticker { background: transparent !important; border-color: transparent !important; padding: 0 !important; box-shadow: none !important; }
    .msg-sticker-img { display: block; width: 120px; height: 120px; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
    .msg-sticker .reply-context { margin-bottom: 4px; }
    .sticker-panel {
        width: 100%; max-height: min(40vh, 284px); display: flex; flex-direction: column; gap: 6px; padding: 6px;
        background: rgba(15,23,42,0.78); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; box-sizing: border-box;
    }
    /* v62：貼圖分類標籤與每一類的格子 */
    .sticker-tabs { display: flex; gap: 6px; flex: 0 0 auto; }
    .sticker-tab {
        appearance: none; -webkit-appearance: none; flex: 1 1 0; min-width: 0; margin: 0; cursor: pointer; touch-action: manipulation;
        padding: 6px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04);
        color: #cbd5e1; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap;
    }
    .sticker-tab small { font-weight: 500; opacity: 0.7; margin-left: 2px; }
    .sticker-tab[aria-selected="true"] { background: rgba(167,139,250,0.28); border-color: rgba(196,181,253,0.65); color: #fff; }
    .sticker-tab:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 1px; }
    .sticker-grid {
        flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
        display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 4px;
    }
    .sticker-choice {
        appearance: none; -webkit-appearance: none; border: 0; margin: 0; padding: 4px; border-radius: 12px;
        background: transparent; cursor: pointer; aspect-ratio: 1 / 1; min-width: 0; touch-action: manipulation;
    }
    .sticker-choice:hover { background: rgba(255,255,255,0.07); }
    .sticker-choice:active { transform: scale(0.94); }
    .sticker-choice:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 1px; }
    .sticker-choice img { display: block; width: 100%; height: 100%; pointer-events: none; }
    /* v61：密語。倒數在「常用訊息」那一列（v154 起在右邊）；交換密語的卡片出現在聊天內容裡。 */
    .pass-pill {
        appearance: none; -webkit-appearance: none; border: 1px solid rgba(196,181,253,0.35); margin: 0;
        background: rgba(124,58,237,0.16); color: #e9d5ff; border-radius: 999px; padding: 1px 10px;
        font-size: 0.74rem; font-weight: 700; line-height: 1.6; cursor: pointer; white-space: nowrap;
        font-variant-numeric: tabular-nums; touch-action: manipulation;
    }
    .pass-pill:hover { background: rgba(124,58,237,0.28); }
    .pass-pill:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    .pass-pill.pass-done { border-color: rgba(52,211,153,0.45); background: rgba(16,185,129,0.14); color: #a7f3d0; }
    .pass-card-wrap { display: flex; justify-content: center; margin: 8px 0; }
    .pass-card {
        position: relative;   /* v69：右上角的叉 */
        width: min(100%, 420px); box-sizing: border-box; padding: 12px 34px; border-radius: 16px; text-align: center;
        background: linear-gradient(135deg, rgba(124,58,237,0.20), rgba(236,72,153,0.14));
        border: 1px solid rgba(196,181,253,0.35); color: #f1f5f9;
    }
    .pass-card-close.q-btn { position: absolute; top: 4px; right: 4px; color: #cbd5e1; min-width: 28px; min-height: 28px; }
    /* v70：檢舉視窗的說明 */
    .report-explain { margin: 8px 0 0; padding-left: 1.1rem; list-style: disc; font-size: 0.75rem; line-height: 1.6; color: #94a3b8; }
    .report-explain li { margin: 2px 0; }
    .report-explain b { color: #e2e8f0; font-weight: 700; }
    /* v70：說明頁「封鎖與檢舉」卡片裡的條列 */
    .seo-guide .guide-card ul { padding-left: 1.2rem; margin: 0.3rem 0 0; }
    .seo-guide .guide-block-faq { margin-top: 0.75rem; }
    .seo-guide .guide-card li { margin: 0.25rem 0; }
    .pass-card-close.q-btn:hover, .pass-card-close.q-btn:focus-visible { color: #fff; background: rgba(255,255,255,0.10); }
    .pass-card-title { font-size: 0.95rem; font-weight: 800; line-height: 1.6; }
    .pass-card-note { margin-top: 4px; font-size: 0.78rem; color: #cbd5e1; line-height: 1.6; }
    .pass-card-actions { justify-content: center; gap: 8px; margin-top: 10px; }
    /* v82：三人聊天的密語卡片下半部，只和其中一位交換 */
    .pass-pair-section { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(196,181,253,0.35); }
    .pass-pair-section.pass-pair-alone { margin-top: 0; padding-top: 0; border-top: 0; }
    .pass-pair-head { font-size: 0.82rem; font-weight: 700; color: #e9d5ff; line-height: 1.6; }
    .pass-pair-head span { font-weight: 500; color: #cbd5e1; }
    .pass-pair-row { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(15,23,42,0.35); }
    .pass-pair-text { font-size: 0.85rem; font-weight: 700; line-height: 1.6; }
    .pass-pair-note { margin-top: 2px; font-size: 0.74rem; color: #cbd5e1; line-height: 1.6; }
    .pass-pair-btn.q-btn { color: #e9d5ff; border-radius: 999px; font-weight: 700; }
    .pass-code {
        display: inline-block; margin: 6px 0 2px; padding: 4px 12px; border-radius: 10px; letter-spacing: 0.04em;
        background: rgba(15,23,42,0.6); border: 1px dashed rgba(196,181,253,0.6); color: #fde68a;
        font-size: 1.15rem; font-weight: 800; user-select: all; -webkit-user-select: all;
    }
    .pass-copy {
        appearance: none; -webkit-appearance: none; margin-left: 6px; padding: 2px 10px; border-radius: 999px; cursor: pointer;
        border: 1px solid rgba(196,181,253,0.5); background: transparent; color: #c4b5fd; font-size: 0.75rem; font-weight: 700;
    }
    .pass-copy:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    /* v131：大廳的「密語配對」改成外框膠囊，看得出來是按鈕（以前只有文字和鑰匙，像一行說明）。 */
    .pass-entry-btn {
        min-height: 44px; padding: 0 20px !important; border-radius: 999px;
        border: 1px solid rgba(165,180,252,0.55); background: rgba(99,102,241,0.16) !important;
        color: #e0e7ff !important; font-weight: 700; box-shadow: 0 4px 16px rgba(79,70,229,0.18);
    }
    .pass-entry-btn:hover { background: rgba(99,102,241,0.28) !important; }
    .pass-entry-btn .q-icon { color: #a5b4fc; }
    .pass-saved-row {
        display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
        width: 100%; padding: 8px 10px; border-radius: 12px; box-sizing: border-box;
        background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    }
    .pass-saved-text { min-width: 0; }
    .pass-saved-code { color: #fde68a; font-weight: 800; letter-spacing: 0.03em; overflow-wrap: anywhere; }
    .pass-saved-label { color: #94a3b8; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pass-note-title { color: #f1f5f9; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; }
    .pass-shared-display { margin-block: 6px; color: #c4b5fd; font-size: 0.78rem; line-height: 1.45; }
    .pass-shared-display span { display: block; color: #f1f5f9; font-weight: 750; overflow-wrap: anywhere; }
    .shared-note-preview { width: 100%; padding: 10px 12px; border-radius: 10px; background: #27264b;
                           color: #f1f5f9; overflow-wrap: anywhere; white-space: pre-wrap; }
    .pass-note-panel { grid-column: 1 / -1; min-width: 0; }
    .pass-note-panel[hidden], .pass-note-title[hidden] { display: none; }
    .pass-note-form { display: grid; gap: 6px; }
    .pass-note-input { width: 100%; min-height: 40px; padding: 8px; font-size: 16px; color: #f1f5f9;
                       background: #11152e; border: 1px solid #64748b; border-radius: 8px; }
    .pass-note-actions { display: flex; flex-wrap: wrap; gap: 4px; }
    .pass-note-button { min-height: 32px; padding: 3px 8px; border-radius: 8px; color: #ddd6fe;
                        background: rgba(167,139,250,0.1); font-size: 0.8rem; cursor: pointer; }
    .pass-note-edit { background: transparent; padding-left: 0; }
    .pass-note-error { color: #fca5a5; font-size: 0.8rem; }
    /* v101：提醒約好下次碰面的時間，寫進密語的備註 */
    .pass-meet {
        margin-top: 10px; padding: 10px 12px; border-radius: 12px; text-align: left;
        background: rgba(15,23,42,0.45); border: 1px solid rgba(253,230,138,0.35);
    }
    .pass-meet-title { font-size: 0.88rem; font-weight: 800; color: #fde68a; line-height: 1.5; }
    .pass-meet-text { margin-top: 2px; font-size: 0.76rem; color: #cbd5e1; line-height: 1.6; }
    .pass-meet-saved { margin-top: 6px; font-size: 0.85rem; }
    .pass-meet-saved::before { content: '📝 已寫下：'; color: #fde68a; font-weight: 700; }
    .pass-meet-edit { margin-top: 8px; border: 1px solid rgba(253,230,138,0.45); color: #fef3c7; font-weight: 700; }
    .pass-meet-form { margin-top: 8px; }
    .pass-meet-label { display: grid; gap: 4px; font-size: 0.75rem; color: #e2e8f0; }
    .pass-meet-count { font-size: 0.72rem; color: #94a3b8; }
    .pass-note-missing { margin-top: 2px; font-size: 0.74rem; color: #fde68a; }
    .pass-note-missing[hidden], .leave-meet[hidden] { display: none; }
    .leave-meet {
        margin: -12px 0 14px; padding: 8px 10px; border-radius: 10px; font-size: 0.82rem; line-height: 1.6;
        color: #fef3c7; background: rgba(253,230,138,0.10); border: 1px solid rgba(253,230,138,0.35);
    }
    .pass-new { margin-top: 4px; text-align: center; color: #cbd5e1; font-size: 0.8rem; line-height: 1.6; }
    /* v65：密語房間人數 */
    .pass-size-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; width: 100%; }
    .pass-size-label { color: #cbd5e1; font-size: 0.85rem; font-weight: 600; }
    .pass-size-toggle { border: 1px solid rgba(167,139,250,0.35); border-radius: 999px; }
    .pass-size-toggle .q-btn { min-height: 40px; padding: 0 18px; font-weight: 600; }
    .pass-size-hint { width: 100%; text-align: center; color: #94a3b8; font-size: 0.78rem; line-height: 1.5; }
    .pass-size-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 0.7rem;
                     color: #ddd6fe; background: rgba(167,139,250,0.18); vertical-align: 1px; }
    /* v144：密語的碰面時間 */
    .pass-share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
    .pass-meet-line { margin-top: 4px; color: #a7f3d0; font-size: 0.8rem; font-weight: 700; line-height: 1.5; }
    .pass-meet-line.past { color: #94a3b8; font-weight: 500; }
    .pass-meet-line[hidden], .pass-meet-panel[hidden] { display: none; }
    .pass-meet-input { color-scheme: dark; }
    .meet-card input[type=datetime-local] { color-scheme: dark; }
    .meet-code { color: #cbd5e1; font-size: 0.85rem; }
    .meet-preview { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border-radius: 10px; background: #27264b; }
    .meet-preview strong { color: #fde68a; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
    .meet-preview span { color: #cbd5e1; font-size: 0.8rem; }
    .meet-reminders {
        position: fixed; top: calc(var(--tt-marquee-h, 0px) + env(safe-area-inset-top, 0px) + 10px); left: 50%;
        transform: translateX(-50%); z-index: 6500; display: grid; gap: 8px;
        width: min(420px, calc(100vw - 20px)); pointer-events: none;
    }
    .meet-reminder {
        pointer-events: auto; padding: 12px 14px; border-radius: 14px; color: #f1f5f9; text-align: left;
        background: #1e1b4b; border: 1px solid rgba(253,230,138,0.6); box-shadow: 0 12px 32px rgba(0,0,0,0.45);
        animation: meet-in 0.25s ease-out;
    }
    .meet-reminder.urgent { background: #3a2a0b; border-color: #f59e0b; }
    .meet-reminder-title { color: #fde68a; font-size: 1rem; font-weight: 800; line-height: 1.4; }
    .meet-reminder-when { margin-top: 4px; font-weight: 750; overflow-wrap: anywhere; }
    .meet-reminder-label, .meet-reminder-hint { margin-top: 2px; color: #cbd5e1; font-size: 0.8rem; line-height: 1.5; overflow-wrap: anywhere; }
    .meet-reminder-hint[hidden] { display: none; }
    .meet-reminder-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
    .meet-reminder-actions button {
        min-height: 40px; padding: 0 14px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer;
        color: #ede9fe; background: rgba(167,139,250,0.16); border: 1px solid rgba(167,139,250,0.4);
    }
    .meet-reminder-actions button[data-meet-action="start"] { color: #1e1b4b; background: #fde68a; border-color: #fde68a; }
    .meet-reminder-actions button[hidden] { display: none; }
    .meet-reminder-actions button:focus-visible { outline: 2px solid #fde68a; outline-offset: 2px; }
    @keyframes meet-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
    @media (prefers-reduced-motion: reduce) { .meet-reminder { animation: none; } }
    /* === 訊息操作列：預設收合，避免回覆 / 心情 / 收回阻擋閱讀 === */
    .msg-shell {
        position: relative;
        /* v59：點兩下訊息開啟操作列；手機點兩下不放大畫面，兩指縮放與捲動不受影響。 */
        touch-action: manipulation;
    }
    .msg-bubble:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    .message-action-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        align-items: center;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        pointer-events: none;
        margin-top: 0;
        margin-bottom: 0;
        transform: translateY(-4px);
        transition: max-height 0.2s ease, opacity 0.18s ease, transform 0.18s ease, margin 0.18s ease;
    }
    /* v59：桌機連點兩下／手機點兩下後由 JS 明確展開；hover、取得焦點或只點一下都不展開。 */
    .msg-shell.actions-open .message-action-row {
        max-height: 180px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-top: -0.18rem;
        margin-bottom: 0.22rem;
        transform: translateY(0);
    }
    .message-action-row.action-row-me { justify-content: flex-end; padding-right: 52px; }
    .message-action-row.action-row-partner { justify-content: flex-start; padding-left: 52px; }
    .recall-action-row {
        display: flex;
        justify-content: flex-end;
        padding-right: 52px;
        margin-top: -0.35rem;
        margin-bottom: 0.25rem;
    }
    /* 訊息操作是一般 HTML 按鈕（由事件委派處理），每則訊息不再各建 7 個 Quasar 元件。 */
    .tt-act {
        display: inline-flex; align-items: center; justify-content: center;
        font-family: inherit; line-height: 1.4; cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    /* 與 v32 的 Quasar 按鈕外觀一致：圖示 1.715em、與文字間隔 6px、主色文字。 */
    .tt-act .q-icon { font-size: 1.715em; margin-right: 6px; }
    .tt-act.message-mini-btn, .tt-act.recall-btn { color: var(--q-primary, #5898d4) !important; }
    .tt-act:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 1px; }
    .message-mini-btn, .recall-btn, .reaction-btn {
        min-height: 24px !important;
        padding: 0.12rem 0.55rem !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,0.035) !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        color: #94a3b8 !important;
        font-size: 0.72rem !important;
        font-weight: 600 !important;
        text-transform: none !important;
        box-shadow: none !important;
    }
    .message-mini-btn:hover {
        background: rgba(168,139,250,0.14) !important;
        border-color: rgba(168,139,250,0.35) !important;
        color: #e9d5ff !important;
    }
    .reaction-btn {
        min-width: 26px !important;
        padding: 0.1rem 0.36rem !important;
        color: #e2e8f0 !important;
    }
    @media (hover: hover) {
        .reaction-btn:hover {
            background: rgba(251,191,36,0.14) !important;
            border-color: rgba(251,191,36,0.35) !important;
            transform: translateY(-1px);
        }
    }
    .recall-btn:hover {
        background: rgba(239,68,68,0.14) !important;
        border-color: rgba(248,113,113,0.35) !important;
        color: #fecaca !important;
    }
    .reply-context {
        margin-bottom: 0.45rem;
        padding: 0.42rem 0.65rem;
        border-left: 3px solid rgba(168,139,250,0.65);
        background: rgba(255,255,255,0.055);
        border-radius: 10px;
        font-size: 0.78rem;
        line-height: 1.35;
        color: #cbd5e1;
        white-space: normal;
    }
    .reply-context .reply-author { color: #ddd6fe; font-weight: 800; margin-bottom: 0.15rem; }
    .reply-context .reply-preview { color: #94a3b8; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .reply-compose {
        width: 100%;
        display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
        margin: 0.15rem 0 0.55rem;
        padding: 0.58rem 0.75rem;
        border-radius: 14px;
        background: rgba(168,139,250,0.10);
        border: 1px solid rgba(168,139,250,0.25);
        box-shadow: 0 8px 22px rgba(0,0,0,0.16);
    }
    .reply-compose .reply-label { font-size: 0.75rem; color: #c4b5fd; font-weight: 800; margin-bottom: 0.12rem; }
    .reply-compose .reply-text { font-size: 0.82rem; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70vw; }
    .reply-compose .reply-cancel {
        width: 28px; height: 28px; border-radius: 999px; border: 0;
        background: rgba(255,255,255,0.08); color: #cbd5e1;
        cursor: pointer; font-size: 1.1rem; line-height: 1;
    }
    .reply-compose .reply-cancel:hover { background: rgba(239,68,68,0.20); color: #fecaca; }
    .reaction-line {
        display: flex; gap: 0.28rem; flex-wrap: wrap;
        padding-left: 52px; margin-top: -0.12rem; margin-bottom: 0.22rem;
    }
    .reaction-line.reaction-line-me { justify-content: flex-end; padding-left: 0; padding-right: 52px; }
    .reaction-pill {
        display: inline-flex; align-items: center; gap: 0.28rem;
        max-width: 100%;
        padding: 0.12rem 0.5rem 0.12rem 0.42rem;
        border-radius: 999px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.10);
        font-size: 0.82rem;
        line-height: 1.35;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    }
    /* v50：表情旁標出是誰給的，名字用各自的訊息顏色（和訊息上方的名字一致）。 */
    .reaction-names { font-size: 0.68rem; font-weight: 800; white-space: normal; overflow-wrap: anywhere; }
    .reaction-sep { color: #64748b; font-weight: 600; }
    .reaction-pill.reaction-pill-mine { background: rgba(251,191,36,0.10); border-color: rgba(251,191,36,0.42); }
    /* 操作列標出「我目前選的心情」：反應列外層的 class 由伺服器設定，緊接在後的就是同一則訊息的操作列。 */
    .react-mine-0 + * .reaction-btn[data-r="0"], .react-mine-1 + * .reaction-btn[data-r="1"],
    .react-mine-2 + * .reaction-btn[data-r="2"], .react-mine-3 + * .reaction-btn[data-r="3"],
    .react-mine-4 + * .reaction-btn[data-r="4"], .react-mine-5 + * .reaction-btn[data-r="5"] {
        background: rgba(251,191,36,0.22) !important;
        border-color: rgba(251,191,36,0.70) !important;
        box-shadow: 0 0 0 1px rgba(251,191,36,0.35) inset !important;
    }
    .recalled-msg-wrapper { display: flex; justify-content: center; width: 100%; }
    .recalled-msg {
        text-align: center;
        color: #94a3b8;
        font-size: 0.78rem;
        margin: 0.45rem auto;
        padding: 0.38rem 0.9rem;
        background: rgba(255,255,255,0.035);
        border: 1px dashed rgba(255,255,255,0.12);
        border-radius: 999px;
        display: inline-block;
        font-style: italic;
    }
    .system-msg-wrapper { display: flex; justify-content: center; width: 100%; }
    .system-msg {
        text-align: center; color: #94a3b8;
        font-size: 0.78rem; margin: 0.6rem auto;
        padding: 0.4rem 1rem;
        background: rgba(255,255,255,0.03);
        border-radius: 999px;
        display: inline-block;
    }
    .intro-msg-wrapper { display: flex; justify-content: center; width: 100%; margin: 0.5rem 0; }
    .intro-msg {
        background: rgba(168,139,250,0.15);
        border: 1px solid rgba(168,139,250,0.3);
        border-radius: 12px;
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        color: #e2e8f0; text-align: center;
        max-width: 85%; line-height: 1.4;
    }
    .intro-msg .lbl { color: #a78bfa; font-weight: 700; margin-right: 0.4rem; }
    /* v126：狀態卡最上面的頭像（一配對就看得到），點了打開資料卡。 */
    .intro-avatar { display: flex; justify-content: center; margin: 0 0 0.35rem; }
    .intro-avatar-img {
        display: block; width: 52px; height: 52px; border-radius: 50%; padding: 2px;
        background: rgba(255,255,255,0.08); box-shadow: 0 0 0 1px rgba(196,181,253,0.25);
    }
    .intro-avatar .msg-avatar-btn:hover .intro-avatar-img { box-shadow: 0 0 0 2px rgba(196,181,253,0.6); }
    /* === v43 興趣：個人設定摘要 === */
    .interest-summary { width: 100%; }
    .interest-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
    .interest-summary-count { color: #a6b0c6; font-size: 0.85rem; }
    .interest-summary-count strong { color: #67e8f9; }
    .interest-open-btn {
        display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px;
        border-radius: 12px; border: 1px solid rgba(167,139,250,0.55); background: rgba(139,92,246,0.14);
        color: #ede9fe; font: inherit; font-weight: 600; cursor: pointer;
    }
    .interest-open-btn .q-icon { font-size: 1.2rem; }
    .interest-summary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
    .interest-summary-chip {
        padding: 5px 11px; border-radius: 999px; background: rgba(103,232,249,0.1);
        border: 1px solid rgba(103,232,249,0.25); color: #a5f3fc; font-size: 0.85rem;
    }
    .interest-summary-more {
        padding: 5px 11px; border-radius: 999px; border: 1px dashed rgba(167,139,250,0.6);
        background: transparent; color: #c4b5fd; font: inherit; font-size: 0.85rem; cursor: pointer;
    }
    .interest-summary-hint { margin: 10px 0 0; color: #94a3b8; font-size: 0.85rem; line-height: 1.6; }
    .interest-open-btn:focus-visible, .interest-summary-more:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }

    /* === v43 興趣挑選視窗：瀏覽器端元件，選取即時反應 === */
    html.tti-open, html.tti-open body { overflow: hidden; }
    .tti-overlay { position: fixed; inset: 0; z-index: 6000; display: flex; align-items: center; justify-content: center; padding: 16px; }
    .tti-overlay[hidden] { display: none; }
    .tti-backdrop { position: absolute; inset: 0; background: rgba(3,6,20,0.72); }
    .tti-panel {
        position: relative; width: min(760px, 100%); height: min(760px, calc(100dvh - 32px));
        display: flex; flex-direction: column; overflow: hidden; outline: none;
        background: #151a31; color: #e2e8f0; border: 1px solid rgba(167,139,250,0.3);
        border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    }
    .tti-head { flex: 0 0 auto; padding: 16px 18px 6px; }
    .tti-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .tti-title-row h2 { margin: 0; font-size: 1.15rem; font-weight: 700; color: #f1f5f9; }
    .tti-icon-btn {
        width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 12px; background: transparent;
        color: #cbd5e1; font: inherit; font-size: 1.15rem; cursor: pointer;
    }
    .tti-help { margin: 2px 0 10px; color: #a6b0c6; font-size: 0.82rem; line-height: 1.55; }
    .tti-search-wrap { position: relative; }
    .tti-search {
        width: 100%; height: 44px; padding: 0 44px 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.18);
        background: #0f1428; color: #f1f5f9; font: inherit; font-size: 16px;  /* 16px：iPhone 聚焦時不會自動放大頁面 */
        -webkit-appearance: none; appearance: none;
    }
    .tti-search::placeholder { color: #7c86a3; }
    .tti-search::-webkit-search-cancel-button { display: none; }
    .tti-search:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,0.25); }
    .tti-search-clear {
        position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; border-radius: 10px;
        background: transparent; color: #a6b0c6; font: inherit; cursor: pointer;
    }
    .tti-search-clear[hidden] { display: none; }
    .tti-tabs { display: flex; gap: 6px; margin-top: 10px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: none; }
    .tti-tabs::-webkit-scrollbar { display: none; }
    .tti-tab {
        flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
        border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04);
        color: #cbd5e1; font: inherit; font-size: 0.85rem; white-space: nowrap; cursor: pointer;
    }
    .tti-tab[aria-pressed="true"] { background: rgba(139,92,246,0.26); border-color: #a78bfa; color: #f5f3ff; }
    .tti-badge {
        min-width: 20px; padding: 0 6px; border-radius: 999px; background: #67e8f9; color: #0b1020;
        font-size: 0.72rem; font-weight: 700; line-height: 20px; text-align: center;
    }
    .tti-badge[hidden] { display: none; }
    .tti-tray {
        flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 18px;
        overflow-x: auto; scrollbar-width: none; border-top: 1px solid rgba(255,255,255,0.06);
    }
    .tti-tray::-webkit-scrollbar { display: none; }
    .tti-tray[hidden] { display: none; }
    .tti-tray { min-height: 50px; }
    .tti-tray-label { flex: 0 0 auto; color: #94a3b8; font-size: 0.78rem; }
    .tti-tray-empty { flex: 0 0 auto; color: #7c86a3; font-size: 0.82rem; }
    .tti-results { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 18px; outline: none; }
    .tti-status { margin: 8px 0 0; color: #94a3b8; font-size: 0.78rem; }
    .tti-group[hidden] { display: none; }
    .tti-group h3 { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 8px; font-size: 0.9rem; font-weight: 600; color: #c4b5fd; }
    .tti-group-count { color: #94a3b8; font-weight: 400; font-size: 0.76rem; }
    .tti-chips { display: flex; flex-wrap: wrap; gap: 8px; }
    .tti-chip {
        display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 9px;
        border-radius: 999px; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.04);
        color: #e2e8f0; font: inherit; font-size: 0.9rem; cursor: pointer; -webkit-tap-highlight-color: transparent;
        transition: background 0.12s ease, border-color 0.12s ease;
    }
    .tti-chip::before {
        content: '+'; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
        background: rgba(255,255,255,0.1); color: #cbd5e1; font-size: 0.85rem; line-height: 1;
    }
    .tti-chip[aria-pressed="true"] { background: rgba(103,232,249,0.16); border-color: #67e8f9; color: #ecfeff; }
    .tti-chip[aria-pressed="true"]::before { content: '✓'; background: #67e8f9; color: #0b1020; font-weight: 700; }
    .tti-chip[hidden] { display: none; }
    .tti-tray .tti-chip { flex: 0 0 auto; min-height: 34px; font-size: 0.85rem; }
    .tti-tray .tti-chip::before { content: '✕'; background: rgba(15,20,40,0.6); color: #a5f3fc; font-size: 0.7rem; }
    .tti-chip mark { background: rgba(250,204,21,0.3); color: inherit; border-radius: 3px; padding: 0 1px; }
    @media (hover: hover) {
        .tti-chip:hover { border-color: rgba(167,139,250,0.65); }
        .tti-tab:hover, .tti-icon-btn:hover { background: rgba(255,255,255,0.08); }
    }
    .tti-empty { padding: 36px 8px; text-align: center; color: #a6b0c6; line-height: 1.7; }
    .tti-empty[hidden] { display: none; }
    .tti-foot {
        flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 18px;
        border-top: 1px solid rgba(255,255,255,0.1); background: #191e37;
    }
    .tti-count { flex: 1 1 auto; color: #cbd5e1; font-size: 0.88rem; }
    .tti-text-btn {
        min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent;
        color: #93c5fd; font: inherit; cursor: pointer;
    }
    .tti-text-btn:disabled { color: #64748b; cursor: default; }
    .tti-done {
        min-height: 44px; padding: 0 24px; border: 0; border-radius: 12px; color: #fff; font: inherit; font-weight: 700;
        background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%); cursor: pointer;
    }
    .tti-overlay button:focus-visible, .tti-search:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    /* 手機與橫向小螢幕：全螢幕；標題、搜尋與完成按鈕固定，只捲動選項。 */
    @media (max-width: 600px), (max-height: 560px) {
        .tti-overlay { padding: 0; }
        .tti-panel { width: 100%; height: 100%; height: 100dvh; border: 0; border-radius: 0; }
        .tti-head { padding: max(10px, env(safe-area-inset-top)) 14px 4px; }
        .tti-help { font-size: 0.78rem; margin-bottom: 8px; }
        .tti-tray { padding: 6px 14px; }
        .tti-results { padding: 0 14px 14px; }
        .tti-foot { padding: 8px 14px max(8px, env(safe-area-inset-bottom)); }
    }
    /* 橫向手機高度很少：隱藏說明與已選列（已選數量仍在分類徽章、「已選」分頁與底部顯示）。 */
    @media (max-height: 560px) {
        .tti-help, .tti-tray { display: none; }
        .tti-title-row h2 { font-size: 1rem; }
        .tti-title-row .tti-icon-btn { width: 40px; height: 40px; }
        .tti-tabs { margin-top: 6px; }
    }
    .profile-interest-list { margin-top: 6px; line-height: 1.6; overflow-wrap: anywhere; }
    .interest-label { color: #c4b5fd; font-weight: 600; }
    .interest-tags { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; vertical-align: middle; }
    .interest-tag {
        display: inline-block; max-width: 100%; padding: 1px 8px; border-radius: 12px;
        background: rgba(103, 232, 249, 0.09); border: 1px solid rgba(103, 232, 249, 0.22);
        color: #a5e5f0; font-size: 0.78rem;
    }
    .interest-empty { color: #94a3b8; }
    .interest-more { margin-top: 3px; }
    .interest-more summary { cursor: pointer; color: #c4b5fd; font-size: 0.76rem; }
    .interest-more summary:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; border-radius: 4px; }
    .interest-tag.common { background: rgba(250,204,21,0.14); border-color: rgba(250,204,21,0.45); color: #fde68a; }
    .interest-common { margin-top: 4px; color: #fde68a; font-size: 0.8rem; font-weight: 600; }
    /* v147：進階個人資訊（聊天開場那一行、資料卡、設定視窗） */
    .profile-advanced-line { margin-top: 6px; line-height: 1.6; overflow-wrap: anywhere; }
    .profile-advanced-text { color: #e2e8f0; }
    /* v165：喜歡的國家（國旗＋國名）：個人設定摘要、挑選視窗、聊天開場、資料卡 */
    .country-flag, .ttc-flag {
        width: 24px; height: 18px; border-radius: 3px; object-fit: cover; flex: none; vertical-align: -3px;
        background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,0.22);
    }
    .country-chip, .country-tag { display: inline-flex; align-items: center; gap: 6px; }
    .country-tag .country-flag { width: 20px; height: 15px; }
    .ttc-overlay .tti-chip { padding: 0 14px 0 10px; gap: 8px; }
    .ttc-overlay .tti-chip::before { display: none; }                          /* 國旗取代「＋」 */
    .ttc-overlay .tti-chip[aria-pressed="true"]::before,
    .ttc-overlay .tti-tray .tti-chip::before { display: inline-grid; }         /* 選了的打勾；已選列是 ✕ */
    .ttc-full .tti-results .tti-chip[aria-pressed="false"] { opacity: 0.42; }   /* 選滿了：其他國家變淡 */
    .ttc-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(250,204,21,0.12);
                color: #fde68a; font-size: 0.8rem; line-height: 1.5; }
    .ttc-note[hidden] { display: none; }
    .ttc-note.ttc-bump { animation: ttc-bump 0.35s ease; }
    @keyframes ttc-bump { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }
    @media (prefers-reduced-motion: reduce) { .ttc-note.ttc-bump { animation: none; } }
    /* v168：喜歡的花語（插圖 花名｜花語 — 生命格言）：個人設定摘要、挑選視窗、聊天開場、資料卡 */
    .flower-icon { display: inline-block; width: 24px; height: 24px; flex: none; vertical-align: -6px; margin-right: 4px; }   /* 網站的基礎樣式把 img 設成區塊，這裡要跟文字同一行 */
    .profile-flower-line { line-height: 1.7; }
    .profile-flower-line b, .profile-flower-text b { color: #ffffff; }
    .profile-flower-text { margin: 0; line-height: 1.7; color: #e2e8f0; overflow-wrap: anywhere; }
    .flower-summary-card { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 14px;
                           background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
    .flower-summary-card .flower-icon { width: 52px; height: 52px; margin: 0; }
    .flower-summary-text { line-height: 1.6; font-size: 0.92rem; color: #e2e8f0; overflow-wrap: anywhere; }
    .flower-summary-text b { color: #ffffff; }
    .flower-summary-motto { color: #cbd5e1; }
    /* v174：生日密碼（個人設定第 7 點的兩個下拉選單和預覽、聊天開場那一行） */
    .birthday-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 10px; }
    .birthday-preview { margin-top: 10px; padding: 10px 12px; border-radius: 14px;
                        background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
    .birthday-preview .profile-birthday-line { margin-top: 0; }
    .birthday-preview .interest-summary-hint { margin: 0; }
    .birthday-preview .profile-birthday-line + .interest-summary-hint { margin-top: 4px; }
    .profile-birthday-text { color: #ffffff; font-weight: 700; }
    .profile-birthday-card { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }   /* v175：資料卡裡的生日密碼 */
    .ttf-preview { flex: none; display: flex; gap: 12px; align-items: center; min-height: 64px; margin: 0 18px 12px; padding: 10px 12px; border-radius: 14px;
                   background: rgba(250,204,21,0.08); border: 1px solid rgba(250,204,21,0.28); }
    .ttf-preview .flower-icon { width: 48px; height: 48px; margin: 0; }
    .ttf-preview p { margin: 0; line-height: 1.6; font-size: 0.88rem; color: #e2e8f0; overflow-wrap: anywhere; }
    .ttf-preview b { color: #ffffff; }
    .ttf-motto { color: #fde68a; }
    .ttf-preview .ttf-preview-empty { color: #94a3b8; }
    .ttf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
    .ttf-card { position: relative; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; text-align: left;
                background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); color: #e2e8f0; font: inherit; cursor: pointer; }
    .ttf-card[hidden] { display: none; }
    .ttf-card:hover { background: rgba(255,255,255,0.08); }
    .ttf-card:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    .ttf-card .flower-icon { width: 40px; height: 40px; margin: 0; }
    .ttf-card-text { min-width: 0; }
    .ttf-card b { display: block; font-size: 0.92rem; }
    .ttf-card small { display: block; color: #94a3b8; font-size: 0.72rem; line-height: 1.35; }
    .ttf-card[aria-pressed="true"] { background: rgba(167,139,250,0.16); border-color: #a78bfa; box-shadow: 0 0 0 1px #a78bfa inset; }
    .ttf-card[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 4px; right: 7px; color: #c4b5fd; font-weight: 800; font-size: 0.8rem; }
    @media (max-width: 600px) {
        .ttf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .ttf-preview { margin: 0 14px 10px; }
    }
    .adv-item { white-space: nowrap; }   /* 一項不拆開，要換行只在頓號後面換 */
    .profile-advanced-line, .lobby-settings-summary { text-wrap: pretty; }   /* 最後一行不要只剩一個字 */
    .advanced-card { gap: 10px; }
    .advanced-intro { color: #94a3b8; font-size: 0.85rem; line-height: 1.6; }
    .advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
    .advanced-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }   /* v159：五個選單時，最後一個占滿一行 */
    .advanced-looks-head { color: #e2e8f0; font-weight: 700; margin-top: 2px; }
    .advanced-looks-head span { color: #94a3b8; font-weight: 400; font-size: 0.8rem; margin-left: 6px; }
    .advanced-looks-hint { color: #94a3b8; font-size: 0.78rem; line-height: 1.5; margin-top: -6px; }
    .advanced-looks { display: flex; flex-direction: column; gap: 6px; width: 100%; }
    .advanced-looks-group { color: #c4b5fd; font-size: 0.8rem; font-weight: 700; margin-top: 2px; }
    .advanced-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
    .advanced-chip.q-btn {
        min-height: 36px; padding: 2px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
        border: 1px solid rgba(167,139,250,0.32); background: rgba(255,255,255,0.04); color: #dbe4ff;
    }
    .advanced-chip.q-btn.selected { border-color: #a78bfa; background: rgba(167,139,250,0.26); color: #f5f3ff; font-weight: 700; }
    .advanced-chip.q-btn.dim { opacity: 0.5; }
    .advanced-preview {
        width: 100%; padding: 10px 12px; border-radius: 12px; box-sizing: border-box; font-size: 0.85rem;
        background: rgba(255,255,255,0.04); border: 1px dashed rgba(148,163,184,0.35);
    }
    .advanced-preview-title { color: #94a3b8; font-size: 0.75rem; }
    .advanced-preview .profile-advanced-line { margin-top: 2px; }
    .advanced-preview-empty { color: #94a3b8; }
    .tt-adv-menu { background: #1b2148 !important; color: #e2e8f0 !important; }
    .q-select__dialog--dark { background: #1b2148 !important; }   /* 手機上下拉選單是小視窗，上面那條也換成深藍 */
    .tt-adv-menu .q-item { color: #e2e8f0; min-height: 40px; }
    .tt-adv-menu .q-item--active { color: #c4b5fd; font-weight: 700; }
    @media (max-width: 480px) { .advanced-grid { grid-template-columns: 1fr; } }

    /* v73：點頭像打開的資料卡。網站的基本樣式會拿掉對話框置中，這裡補回來。 */
    .profile-card-dialog {
        margin: auto; inset: 0;
        width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow-y: auto;
        padding: 20px; border-radius: 20px; border: 1px solid #535a80; background: #131838; color: #e2e8f0; line-height: 1.6;
    }
    .profile-card-dialog::backdrop { background: rgba(3, 6, 20, 0.72); }
    .profile-card-head { display: flex; align-items: center; gap: 14px; }
    .profile-card-avatar {
        width: 72px; height: 72px; border-radius: 50%; flex: 0 0 auto; padding: 3px; box-sizing: border-box;
        background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    }
    .profile-card-name { margin: 0; font-size: 1.25rem; font-weight: 800; color: #f8fafc; overflow-wrap: anywhere; }
    .profile-card-nick, .profile-card-you { color: #94a3b8; font-size: 0.9rem; font-weight: 600; }
    .profile-card-section { margin-top: 16px; }
    .profile-card-section h3 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 700; color: #c4b5fd; }
    .profile-card-count { color: #94a3b8; font-weight: 400; font-size: 0.82rem; margin-left: 4px; }
    .profile-card-status { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.05);
        white-space: pre-wrap; overflow-wrap: anywhere; color: #f1f5f9; }
    .profile-card-empty { margin: 0; color: #94a3b8; }
    .profile-card-status.profile-card-empty { color: #94a3b8; }
    .profile-card-tags { display: flex; justify-content: flex-start; gap: 6px; }
    .profile-card-tags .interest-tag { font-size: 0.85rem; padding: 2px 10px; }
    .profile-card-common { margin-top: 10px; font-size: 0.85rem; line-height: 1.6; }
    .profile-card-hint { margin: 10px 0 0; color: #94a3b8; font-size: 0.82rem; }
    .profile-card-close {
        display: block; width: 100%; min-height: 44px; margin-top: 18px; border: 0; border-radius: 12px;
        background: #6462cb; color: #fff; font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation;
    }
    .profile-card-close:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }

    /* === 跳到底部按鈕 === */
    .scroll-to-bottom {
        position: absolute;
        bottom: 1rem; right: 1rem;
        width: 44px; height: 44px;
        border-radius: 50%;
        background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
        color: white;
        display: none;
        align-items: center; justify-content: center;
        cursor: pointer;
        box-shadow: 0 8px 24px rgba(99,102,241,0.5);
        z-index: 10;
        animation: popIn 0.25s ease;
        font-size: 1.2rem;
        border: none;
    }
    .scroll-to-bottom.visible { display: flex; }
    .scroll-to-bottom:hover { transform: translateY(-2px) scale(1.05); }
    .scroll-to-bottom .badge {
        position: absolute;
        top: -4px; right: -4px;
        background: #ef4444;
        color: white;
        font-size: 0.65rem; font-weight: 700;
        min-width: 18px; height: 18px;
        border-radius: 999px;
        display: inline-flex; align-items: center; justify-content: center;
        padding: 0 5px;
    }
    @keyframes popIn {
        from { transform: scale(0); }
        to   { transform: scale(1); }
    }

    /* === 🔥 輸入中指示器 === */
    .typing-indicator-row {
        display: flex; align-items: center; min-height: 28px;
        padding: 0.2rem 0.5rem; width: 100%;
        animation: typingFadeIn 0.25s ease;
    }
    @keyframes typingFadeIn {
        from { opacity: 0; transform: translateX(-6px); }
        to   { opacity: 1; transform: translateX(0); }
    }
    .typing-bubble {
        display: inline-flex; align-items: center; gap: 0.5rem;
        padding: 0.4rem 0.95rem;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 999px;
        font-size: 0.78rem;
        color: #cbd5e1;
        backdrop-filter: blur(10px);
    }
    .typing-dots { display: inline-flex; gap: 4px; align-items: center; }
    .typing-dots span {
        width: 6px; height: 6px;
        background: #a78bfa;
        border-radius: 50%;
        animation: typingBounce 1.4s infinite ease-in-out both;
    }
    .typing-dots span:nth-child(1) { animation-delay: -0.32s; }
    .typing-dots span:nth-child(2) { animation-delay: -0.16s; }
    @keyframes typingBounce {
        0%,80%,100% { transform: scale(0.4); opacity: 0.5; }
        40%         { transform: scale(1.0); opacity: 1; }
    }

    /* === 🔥 圖片放大檢視 (Lightbox) === */
    #lightbox-overlay {
        display: none;
        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 99999;
        align-items: center; justify-content: center;
        cursor: zoom-out;
        animation: fadeIn 0.2s ease-out;
    }
    #lightbox-overlay.active { display: flex !important; }
    #lightbox-img {
        max-width: 90vw; max-height: 90vh;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.6);
        object-fit: contain;
        transition: transform 0.2s ease;
    }
    #lightbox-close {
        position: absolute; top: 25px; right: 25px;
        color: rgba(255,255,255,0.7); font-size: 2.5rem;
        background: transparent; border: none;
        cursor: pointer; padding: 10px; line-height: 1;
        transition: color 0.2s ease;
    }
    #lightbox-close:hover { color: white; }
    #lightbox-close { touch-action: manipulation; }
    .quick-edit-btn { font-size:0.75rem; min-height:24px; color:#c4b5fd; padding:0 0.35rem; }
    /* v75：個人設定、大廳、聊天室的「新增常用訊息／管理常用訊息（n/5）」按鈕。 */
    .quick-manage-btn { min-height:36px; border:1px solid #8579bd; border-radius:12px;
        background:#302953; color:#efeaff; padding:0 10px; }
    /* v75：編輯常用訊息，一格一則；手機上格子太多時只有格子那一區捲動。舊版多存的幾則放在虛線下面，等使用者刪減。 */
    .quick-editor-card { width:min(94vw,460px); max-height:85dvh; display:flex; flex-direction:column;
        flex-wrap:nowrap; gap:10px; padding:16px; background:#181a36; color:white; border-radius:20px; }
    .quick-editor-fields { min-height:0; flex:1 1 auto; overflow-y:auto; width:100%; gap:8px; padding:2px; }
    .quick-legacy-box { border-top: 1px dashed rgba(251, 191, 36, 0.45); padding-top: 0.6rem; }
    .quick-default-note { color: #c4b5fd; }
    .quick-legacy-note { color: #fcd34d; }
    .msg-photo:hover .msg-photo-img { opacity: 0.8; }
    .msg-photo:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; border-radius: 12px; }
    /* v62：聊天中的照片和貼圖差不多大（手機 120px、電腦 136px），保留比例不裁切；右下角的放大鏡提示可以點開。 */
    .msg-photo {
        position: relative; display: block; width: fit-content; margin-top: 8px; line-height: 0;
        appearance: none; padding: 0; border: 0; background: none; cursor: zoom-in;
    }
    .msg-bubble > .msg-photo:first-child, .reply-context + .msg-photo { margin-top: 2px; }
    .msg-photo-img {
        display: block; max-width: 120px; max-height: 120px; width: auto; height: auto; border-radius: 12px;
        cursor: zoom-in; transition: opacity 0.2s; background: rgba(255,255,255,0.06); -webkit-touch-callout: none;
    }
    .msg-photo-zoom {
        position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%; pointer-events: none;
        display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1;
        color: #fff; background: rgba(15,23,42,0.66);
    }

    /* === 快速訊息貼圖列 === */
    .quick-sticker-area {
        width: 100%;
        padding: 0.2rem 0.2rem 0.35rem;
    }
    .quick-sticker-title {
        font-size: 0.76rem;
        color: #94a3b8;
        letter-spacing: 0.08em;
        margin: 0 0.2rem 0.35rem;
    }
    .quick-sticker-scroll {
        width: 100%;
        display: flex;
        gap: 10px;   /* v145：按鈕之間加寬，手機上不易按錯 */
        overflow-x: auto;
        padding: 0.15rem 0.1rem 0.45rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .quick-sticker-btn {
        flex: 0 0 auto;
        border-radius: 999px !important;
        padding: 0.42rem 0.9rem !important;
        min-height: 40px !important;   /* v145：34px → 40px，比較好按準 */
        background: rgba(255,255,255,0.06) !important;
        border: 1px solid rgba(255,255,255,0.10) !important;
        color: #e2e8f0 !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        text-transform: none !important;
        box-shadow: none !important;
        backdrop-filter: blur(10px);
        transition: all 0.2s ease !important;
    }
    .quick-sticker-btn:hover {
        background: rgba(168,139,250,0.18) !important;
        border-color: rgba(168,139,250,0.45) !important;
        transform: translateY(-1px);
    }
    .quick-sticker-btn[disabled] {
        opacity: 0.45 !important;
        transform: none !important;
        cursor: not-allowed !important;
    }

    /* === 按鈕 === */
    .primary-btn {
        background: linear-gradient(135deg, #6366f1 0%, #a78bfa 60%, #ec4899 100%) !important;
        color: white !important; border: none !important;
        border-radius: 14px !important; padding: 0.7rem 2rem !important;
        font-weight: 600 !important; text-transform: none !important;
        box-shadow: 0 8px 24px rgba(99,102,241,0.4) !important;
        transition: all 0.3s ease !important;
    }
    .primary-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 36px rgba(168,139,250,0.55) !important;
    }
    .primary-btn[disabled] {
        background: rgba(255,255,255,0.1) !important;
        box-shadow: none !important; color: #64748b !important;
        cursor: not-allowed !important;
    }
    .danger-btn {
        background: rgba(239,68,68,0.15) !important;
        color: #fca5a5 !important;
        border: 1px solid rgba(239,68,68,0.4) !important;
        border-radius: 14px !important; padding: 0.6rem 1.5rem !important;
        text-transform: none !important;
    }
    .danger-btn:hover { background: rgba(239,68,68,0.25) !important; color: #fecaca !important; }
    .compact-bar .danger-btn { padding: 0.35rem 0.9rem !important; font-size: 0.8rem !important; }

    /* === 輸入框 === */
    .q-field--outlined .q-field__control {
        background: rgba(255,255,255,0.05) !important;
        border-radius: 14px !important;
    }
    .q-field--outlined .q-field__control:before { border-color: rgba(255,255,255,0.12) !important; }
    .q-field--outlined .q-field__control:hover:before { border-color: rgba(168,139,250,0.5) !important; }
    .q-field__native, .q-field__input { color: #f1f5f9 !important; }
    .q-field__native::placeholder { color: #64748b !important; }
    /* v71：iPhone（Safari 與 Chrome）點進字小於 16px 的輸入框，會自動放大整個頁面，鍵盤收起後也不會縮回，
       聊天畫面就被切掉、看不到頭像。手機與平板上的文字輸入框一律 16px，就不會觸發自動放大。 */
    @media (pointer: coarse), (max-width: 560px) {
        .q-field__native, .q-field__input, textarea,
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
        select { font-size: max(16px, calc(16px * var(--tt-font-scale, 1))) !important; }   /* v110：字體調大時一起變大 */
        /* 字變大後，窄手機放不下整句提示「輸入訊息...  Type a message」，超出的部分用「…」收尾。 */
        .message-input-area .q-field__native { text-overflow: ellipsis; }
    }

    /* === v27：上方列的檢舉按鈕 === */
    .compact-bar { flex-wrap: nowrap; gap: 0.5rem; }
    .compact-bar > .compact-brand { flex: 1 1 0; min-width: 0; overflow: hidden; }
    .compact-bar .left-side { min-width: 0; flex: 1 1 auto; overflow: hidden; }
    .compact-bar .status-pill-mini { min-width: 0; white-space: nowrap; }
    #compact-status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .compact-bar .bar-actions { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: nowrap; flex: 0 0 auto; }
    .bar-icon-btn {
        width: 36px; height: 36px;
        color: #cbd5e1 !important;
        background: rgba(255,255,255,0.06) !important;
        border: 1px solid rgba(255,255,255,0.10) !important;
    }
    .bar-icon-btn:hover { background: rgba(168,139,250,0.18) !important; color: #fff !important; }
    /* v53 背景提示音開關：狀態放在 html[data-tt-sound]，所以伺服器重畫按鈕也不會顯示錯誤的狀態。 */
    html[data-tt-sound="off"] .when-sound-on, html:not([data-tt-sound="off"]) .when-sound-off { display: none !important; }
    .sound-btn {
        display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%;
        cursor: pointer; font-size: 20px; -webkit-tap-highlight-color: transparent;
    }
    .sound-btn .q-icon { font-size: 20px; color: var(--q-primary, #5898d4); }   /* 與旁邊的 Quasar 圖示按鈕同色 */
    .sound-btn:focus-visible, .sound-pill:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    .sound-setting { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
    .sound-pill {
        display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
        font: inherit; font-size: 0.85rem; font-weight: 600; color: #e9d5ff;
        background: rgba(168,139,250,0.12); border: 1px solid rgba(168,139,250,0.35);
    }
    html[data-tt-sound="off"] .sound-pill { color: #94a3b8; background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); }
    .sound-pill .q-icon { font-size: 18px; }
    .cooldown-hint { text-align: center; color: #a5b4fc; font-size: 0.78rem; margin: -0.3rem 0 0.6rem; }
    .ended-chat-actions {
        width: 100%; padding: 8px; gap: 6px; align-items: center;
        background: rgba(129, 140, 248, 0.08); border-radius: 14px;
    }
    .ended-chat-buttons { width: 100%; gap: 8px; flex-wrap: wrap; }
    .ended-chat-buttons .q-btn { flex: 1 1 140px; min-height: 40px; }
    .maintenance-notice {
        width: 100%; padding: 8px 10px; border-radius: 10px; text-align: center;
        color: #fef3c7; background: #3b2e22; border: 1px solid #84623c; font-size: .875rem;
    }
    .maintenance-lobby-timing { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
    .maintenance-lobby-timing:not(:empty) { margin-top: 4px; }
    .maintenance-lobby-timing strong { font-variant-numeric: tabular-nums; }
    .trio-refill-actions {
        width: 100%; gap: 4px 8px; align-items: center; flex-wrap: wrap; padding: 4px 8px;
        background: rgba(129, 140, 248, 0.08); border-radius: 12px;
    }
    .trio-refill-actions .q-btn { min-height: 32px; }
    @media (max-width: 360px) {
        .compact-bar .logo-text { display: none; }
    }

    /* === SEO 介紹與常見問題（伺服器端 HTML，位於 NiceGUI 畫面之後） === */
    /* body_html 在 #app 之前輸出；用 flex order 把它排到畫面最下方，不需要 JS 搬移。 */
    body { display: flex; flex-direction: column; }
    body > #app { width: 100%; }
    #threetalk-guide { order: 1; }
    body.in-chat #threetalk-guide { display: none !important; }
    .seo-guide {
        width: 100%; max-width: 880px; margin: 0 auto; box-sizing: border-box;
        padding: 1.5rem 1rem 0; color: #cbd5e1; font-size: 0.95rem; line-height: 1.8;
    }
    .seo-guide h1, .seo-guide h2 {
        color: #f1f5f9; font-size: 1.3rem; font-weight: 800;
        line-height: 1.45; letter-spacing: normal; margin: 2.4rem 0 0.9rem;
    }
    .seo-guide h2:first-of-type { margin-top: 1rem; }
    .seo-guide h3 {
        color: #e9d5ff; font-size: 1rem; font-weight: 700;
        line-height: 1.5; letter-spacing: normal; margin: 0 0 0.35rem;
    }
    .seo-guide p { margin: 0 0 0.8rem; }
    .seo-guide ol, .seo-guide ul { margin: 0; padding-left: 1.4rem; }
    .seo-guide ol { list-style: decimal; }
    .seo-guide ul { list-style: disc; }
    .seo-guide li { margin: 0.35rem 0; }
    .seo-guide li::marker { color: #a78bfa; font-weight: 700; }
    .guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; }
    .guide-faq { display: grid; gap: 0.7rem; }
    .guide-card {
        padding: 1rem 1.15rem; border-radius: 18px;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(255,255,255,0.07);
    }
    .guide-card p { margin: 0; color: #94a3b8; font-size: 0.9rem; line-height: 1.75; }
    .guide-noscript { color: #fde68a; }
    /* v59：最近更新，版本與日期固定寬度，說明文字自動換行。 */
    .seo-guide ol.guide-updates { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
    .seo-guide .guide-update {
        display: grid; grid-template-columns: 3.2rem 3rem minmax(0, 1fr); align-items: baseline; gap: 0.6rem;
        margin: 0; padding: 0.65rem 1rem; border-radius: 14px;
        background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    }
    .guide-update .update-version { color: #c4b5fd; font-weight: 800; }
    .guide-update time { color: #64748b; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
    .guide-update .update-note { color: #cbd5e1; font-size: 0.9rem; line-height: 1.7; }
    .seo-guide .brand-footer { margin-top: 2.5rem; border-top: 1px solid rgba(255,255,255,0.06); }
    /* v83：說明頁依標題收合。標題一直看得到，內容收在標題下面。 */
    .seo-guide .guide-fold-hint { margin: 0.4rem 0 0.2rem; color: #64748b; font-size: 0.8rem; }
    .seo-guide .guide-section {
        margin: 0.75rem 0 0; border-radius: 18px;
        background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07);
    }
    .seo-guide .guide-section[open] { background: rgba(255,255,255,0.035); border-color: rgba(167,139,250,0.28); }
    .seo-guide .guide-section-summary, .seo-guide .guide-item-summary {
        list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.6rem;
        -webkit-tap-highlight-color: transparent;
    }
    .seo-guide .guide-section-summary::-webkit-details-marker,
    .seo-guide .guide-item-summary::-webkit-details-marker { display: none; }
    .seo-guide .guide-section-summary { padding: 0.85rem 1.1rem; min-height: 52px; box-sizing: border-box; border-radius: 18px; }
    .seo-guide .guide-section-summary h2 { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 1.12rem; }
    .seo-guide .guide-section-hint {
        flex: none; color: #94a3b8; font-size: 0.78rem; font-weight: 600; white-space: nowrap;
        padding: 0.1rem 0.55rem; border-radius: 999px; background: rgba(167,139,250,0.12);
    }
    .seo-guide .guide-section-summary::after, .seo-guide .guide-item-summary::after {
        content: ''; flex: none; width: 0.5rem; height: 0.5rem; margin: -0.2rem 0.15rem 0 0.1rem;
        border-right: 2px solid #a78bfa; border-bottom: 2px solid #a78bfa; transform: rotate(45deg);
        transition: transform 0.2s ease, margin 0.2s ease;
    }
    .seo-guide details[open] > .guide-section-summary::after,
    .seo-guide details[open] > .guide-item-summary::after { transform: rotate(-135deg); margin-top: 0.25rem; }
    .seo-guide .guide-section-summary:focus-visible, .seo-guide .guide-item-summary:focus-visible {
        outline: 2px solid #a78bfa; outline-offset: 2px;
    }
    .seo-guide .guide-section-body { padding: 0 1.1rem 1.1rem; }
    .seo-guide .guide-section-tools { display: flex; justify-content: flex-end; margin: -0.2rem 0 0.6rem; }
    .seo-guide .guide-expand-all {
        border: 1px solid rgba(167,139,250,0.35); background: transparent; color: #c4b5fd; cursor: pointer;
        font: inherit; font-size: 0.8rem; font-weight: 700; padding: 0.25rem 0.8rem; border-radius: 999px; min-height: 32px;
    }
    .seo-guide .guide-expand-all:hover, .seo-guide .guide-expand-all:focus-visible { color: #f1f5f9; border-color: #a78bfa; }
    .seo-guide .guide-grid { align-items: start; }
    .seo-guide .guide-item { padding: 0; }
    .seo-guide .guide-item-summary { padding: 0.8rem 1.05rem; min-height: 48px; box-sizing: border-box; border-radius: 18px; }
    .seo-guide .guide-item-summary h3 { margin: 0; flex: 1 1 auto; min-width: 0; }
    .seo-guide .guide-item-body { padding: 0 1.05rem 0.95rem; }
    .seo-guide .guide-item[open] { border-color: rgba(167,139,250,0.25); }
    /* v84：頻道選擇與 18 歲以上確認 */
    .channel-heading { font-size: 0.85rem; color: #94a3b8; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
    /* v131：大廳「SETTINGS · 設定」：四個設定按鈕一排，下面是目前設定和興趣。 */
    .lobby-settings {
        width: 100%; max-width: 720px; margin: 0.5rem auto 0.3rem; padding: 0; box-sizing: border-box;
        display: flex; flex-direction: column; align-items: center; gap: 0;
        border-radius: 18px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    }
    /* v161：設定可以收合，預設收合（html 上的 data-tt-lobby-settings="open" 才打開）。
       整條標題列是一顆按鈕：齒輪＋標題＋一行目前設定（收合時才顯示）＋「展開／收起」。 */
    .lobby-settings-toggle {
        appearance: none; border: 0; background: transparent; font: inherit; color: #cbd5e1; cursor: pointer; text-align: left;
        width: 100%; min-height: 46px; box-sizing: border-box; display: flex; align-items: center; gap: 10px;
        padding: 0.7rem 1rem; border-radius: 18px;
    }
    @media (hover: hover) { .lobby-settings-toggle:hover { background: rgba(167,139,250,0.08); } }
    .lobby-settings-toggle:focus-visible { outline: 2px solid #a78bfa; outline-offset: -2px; }
    .lobby-settings-title {
        display: inline-flex; align-items: center; gap: 8px; flex: none;
        font-size: 0.85rem; letter-spacing: 0.1em; color: #c7d2fe; white-space: nowrap;
    }
    .lobby-settings-title .q-icon { font-size: 1.25rem; color: #a5b4fc; }
    .lobby-settings-title .lst-short { display: none; }
    .lobby-settings-peek {
        flex: 1 1 auto; min-width: 0; font-size: 0.78rem; color: #94a3b8;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .lobby-settings-more {
        display: inline-flex; align-items: center; gap: 2px; flex: none; margin-left: auto;
        font-size: 0.78rem; color: #a5b4fc; white-space: nowrap;
    }
    .lobby-settings-more .q-icon { font-size: 1.3rem; transition: transform 0.2s ease; }
    .lobby-settings-more .when-settings-open { display: none; }
    .lobby-settings-body {
        display: none; flex-direction: column; align-items: center; gap: 0.4rem;
        width: 100%; padding: 0.1rem 0.9rem 0.75rem; box-sizing: border-box;
    }
    html[data-tt-lobby-settings="open"] .lobby-settings-body { display: flex; }
    html[data-tt-lobby-settings="open"] .lobby-settings-toggle { border-radius: 18px 18px 0 0; }
    html[data-tt-lobby-settings="open"] .lobby-settings-peek { visibility: hidden; }   /* 打開後下面就有目前設定 */
    html[data-tt-lobby-settings="open"] .lobby-settings-more .q-icon { transform: rotate(180deg); }
    html[data-tt-lobby-settings="open"] .lobby-settings-more .when-settings-open { display: inline; }
    html[data-tt-lobby-settings="open"] .lobby-settings-more .when-settings-closed { display: none; }
    @media (prefers-reduced-motion: reduce) { .lobby-settings-more .q-icon { transition: none; } }
    @media (max-width: 480px) {   /* 手機：標題只寫「設定」、不寫「展開／收起」，留更多位置給目前設定 */
        .lobby-settings-toggle { padding: 0.7rem 0.75rem 0.7rem 0.9rem; }
        .lobby-settings-title .lst-full, .lobby-settings-more .lst-word { display: none !important; }
        .lobby-settings-title .lst-short { display: inline; }
    }
    .nicegui-row.lobby-settings-actions { justify-content: center; gap: 0.5rem; width: 100%; margin-bottom: 0.2rem; }
    .lobby-settings-actions .q-btn {
        min-height: 42px; padding: 0 12px; border-radius: 12px; font-size: 0.85rem;
        border: 1px solid rgba(167,139,250,0.32); background: rgba(255,255,255,0.045); color: #dbe4ff;
    }
    .lobby-settings-actions .q-btn:hover { background: rgba(167,139,250,0.14); }
    .lobby-settings-actions .q-btn .q-icon { color: #a5b4fc; }
    .lobby-settings-summary { color: #94a3b8; font-size: 0.75rem; line-height: 1.6; text-align: center; }
    .channel-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; width: 100%; margin-bottom: 0.4rem; }
    .channel-chip {
        appearance: none; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); color: #cbd5e1;
        font: inherit; font-size: 0.9rem; font-weight: 700; padding: 0.45rem 1rem; min-height: 44px; border-radius: 999px;
        cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    }
    .channel-chip:hover { border-color: rgba(167,139,250,0.5); color: #f1f5f9; }
    .channel-chip:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
    .channel-chip.selected { border-color: #a78bfa; background: rgba(167,139,250,0.18); color: #f5f3ff; }
    .channel-chip.disabled, .channel-chip[disabled] { opacity: 0.45; cursor: not-allowed; }
    .channel-note { max-width: 420px; margin: 0 auto 0.8rem; color: #c4b5fd; font-size: 0.78rem; line-height: 1.6; text-align: center; }
    .age-gate {
        width: 100%; max-width: 560px; margin: 1.2rem auto 0; padding: 0.9rem 1.1rem; box-sizing: border-box;
        border-radius: 16px; border: 1px solid rgba(251,191,36,0.4); background: rgba(251,191,36,0.07);
    }
    .age-gate-title { color: #fde68a; font-weight: 800; font-size: 0.95rem; line-height: 1.6; }
    .age-gate-text { margin-top: 0.3rem; color: #e2e8f0; font-size: 0.82rem; line-height: 1.7; }
    .age-gate-check { margin-top: 0.4rem; color: #f8fafc; font-weight: 700; }
    /* v83：大廳的三人配對規則收成一行，點了才看細節 */
    .trio-rules { width: 100%; max-width: 420px; margin: 0.35rem auto 0; font-size: 0.75rem; line-height: 1.6; color: #94a3b8; text-align: center; }
    .trio-rules > summary {
        list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem;
        padding: 0.3rem 0.6rem; min-height: 32px; border-radius: 999px; color: #cbd5e1;
        -webkit-tap-highlight-color: transparent;
    }
    .trio-rules > summary::-webkit-details-marker { display: none; }
    .trio-rules > summary::after {
        content: ''; width: 0.4rem; height: 0.4rem; margin-top: -0.15rem;
        border-right: 2px solid #a78bfa; border-bottom: 2px solid #a78bfa; transform: rotate(45deg); transition: transform 0.2s ease;
    }
    .trio-rules[open] > summary::after { transform: rotate(-135deg); margin-top: 0.2rem; }
    .trio-rules > summary:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
    .trio-rules-body { margin: 0.2rem 0 0; }

    /* v124：首頁與大廳的「隱私與使用重點」，預設收起來，點了才展開。 */
    .key-points { width: 100%; max-width: 480px; margin: 0.6rem auto 0.4rem; color: #94a3b8; font-size: 0.8rem; line-height: 1.7; }
    .key-points > summary {
        list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
        box-sizing: border-box; width: fit-content; max-width: 100%; margin: 0 auto; padding: 0.4rem 1rem; min-height: 44px; border-radius: 999px;
        border: 1px solid rgba(167,139,250,0.3); background: rgba(255,255,255,0.04);
        color: #e2e8f0; font-size: 0.82rem; font-weight: 600; -webkit-tap-highlight-color: transparent;
    }
    .key-points > summary::-webkit-details-marker { display: none; }
    .key-points > summary::after {
        content: ''; flex: 0 0 auto; width: 0.42rem; height: 0.42rem; margin-top: -0.18rem;
        border-right: 2px solid #a78bfa; border-bottom: 2px solid #a78bfa; transform: rotate(45deg);
        transition: transform 0.2s ease, margin 0.2s ease;
    }
    .key-points[open] > summary::after { transform: rotate(-135deg); margin-top: 0.22rem; }
    .key-points > summary:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
    .key-points-count { color: #94a3b8; font-weight: 500; }
    .key-points-body {
        margin-top: 0.6rem; padding: 0.85rem 1rem 0.75rem; text-align: left; border-radius: 16px;
        background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.08);
    }
    .key-points-body ul { list-style: disc; margin: 0; padding-left: 1.15em; display: grid; gap: 0.4rem; }
    .key-points-body li::marker { color: #a78bfa; }
    .key-points-body b { color: #e2e8f0; font-weight: 700; }
    .key-points-more { margin: 0.6rem 0 0; text-align: center; }
    .key-points-more a { color: #a5b4fc; text-decoration: none; border-bottom: 1px dashed rgba(165,180,252,0.45); }
    .key-points-more a:hover, .key-points-more a:focus-visible { color: #e0e7ff; }
    @media (prefers-reduced-motion: reduce) { .key-points > summary::after { transition: none; } }

    /* v64：論壇使用一般外連，手機也有足夠的觸控範圍。 */
    .forum-link {
        display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap;
        gap: 0.25rem 0.5rem; min-height: 44px; max-width: 100%; padding: 0.5rem 0.75rem;
        box-sizing: border-box; border-radius: 12px; border: 1px solid rgba(167,139,250,0.25);
        background: rgba(167,139,250,0.08); color: #ddd6fe; text-decoration: none;
        font-size: 0.85rem; font-weight: 600; line-height: 1.5;
    }
    .forum-link:hover { background: rgba(167,139,250,0.16); }
    .forum-link:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; }
    .forum-link-hint { color: #c4b5fd; font-size: 0.75rem; font-weight: 400; }

    /* v72：「安裝 ThreeTalk App」。預設不顯示；這個瀏覽器能安裝（或 iPhone 可以加到主畫面）時才出現。 */
    .install-app-wrap { display: none; }
    html.tt-install-ready .install-app-wrap { display: block; }
    .install-app-btn {
        display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap;
        gap: 0.25rem 0.55rem; min-height: 44px; max-width: 100%; padding: 0.45rem 0.9rem; margin: 0.25rem 0;
        box-sizing: border-box; border-radius: 12px; border: 1px solid rgba(96,165,250,0.35);
        background: linear-gradient(135deg, rgba(96,165,250,0.16), rgba(244,114,182,0.14)); color: #e0e7ff;
        font: inherit; font-size: 0.88rem; font-weight: 700; line-height: 1.5; cursor: pointer; touch-action: manipulation;
    }
    .install-app-btn:hover { background: linear-gradient(135deg, rgba(96,165,250,0.26), rgba(244,114,182,0.22)); }
    .install-app-btn:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; }
    .install-app-icon { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto; }
    .install-app-hint { color: #c4b5fd; font-size: 0.75rem; font-weight: 400; }
    /* 網站的基本樣式會把對話框的置中、清單編號和 svg 的排版拿掉，這裡補回來。 */
    .install-guide {
        margin: auto; inset: 0;
        width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow-y: auto;
        padding: 20px; border-radius: 20px; border: 1px solid #535a80; background: #131838; color: #e2e8f0;
        line-height: 1.7;
    }
    .install-guide::backdrop { background: rgba(3, 6, 20, 0.72); }
    .install-guide h2 { margin: 0 0 10px; font-size: 1.15rem; font-weight: 800; color: #f8fafc; }
    .install-guide ol { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; list-style: decimal; }
    .install-guide li { padding-left: 0.2em; }
    .install-guide li::marker { color: #c4b5fd; font-weight: 700; }
    .install-guide p { margin: 10px 0 0; color: #cbd5e1; font-size: 0.9rem; }
    .install-guide .install-guide-intro { margin: 0 0 10px; }
    .install-guide code { word-break: break-all; user-select: all; -webkit-user-select: all; color: #ddd6fe; }
    .install-share-icon { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; color: #93c5fd; }
    .install-guide button {
        display: block; width: 100%; min-height: 44px; margin-top: 12px; border-radius: 12px; font: inherit; font-weight: 700;
        cursor: pointer; touch-action: manipulation;
    }
    .install-guide-close { border: 0; background: #6462cb; color: #fff; }
    .install-guide-copy { border: 1px solid #626187; background: #27264b; color: #e9e5ff; }
    .install-guide button:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }

    /* === 其他覆寫 === */
    .brand-footer { text-align: center; padding: 2rem 1rem 1.5rem; color: #64748b; font-size: 0.72rem; letter-spacing: 0.15em; }
    .brand-footer .divider { margin: 0 0.7rem; color: #334155; }
    .brand-footer a { color: #818cf8; text-decoration: none; }
    .text-gray-800, .text-gray-700 { color: #f1f5f9 !important; }
    .text-gray-500, .text-gray-600 { color: #cbd5e1 !important; }
    .text-gray-400 { color: #94a3b8 !important; }
    .bg-gray-50 { background: transparent !important; }
    .border-gray-200 { border-color: rgba(255,255,255,0.08) !important; }
    @media (max-width: 600px) {
        .product-title { font-size: clamp(3.2rem, 16vw, 3.9rem); }
        .product-title-sm { font-size: clamp(2.6rem, 12vw, 3rem); }
        .product-h1-sub { font-size: 0.95rem; letter-spacing: 0.22em; }
        /* v131：手機上四個設定按鈕排成兩欄，一樣寬、一樣高；字太長時換行，不會擠出畫面。 */
        .nicegui-row.lobby-settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
        .lobby-settings-actions .q-btn { width: 100%; padding: 4px 6px; font-size: 0.8rem; line-height: 1.25; }
        .lobby-settings-actions .q-btn .q-btn__content { flex-wrap: nowrap; white-space: normal; }
        .lobby-settings-actions .q-btn .q-icon { font-size: 1.15rem; margin-right: 4px; }
        .lobby-settings-actions .q-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* v147：第 5 顆按鈕自己一排 */
        .lobby-settings-body { padding: 0.1rem 0.6rem 0.65rem; }   /* v161：原本是整塊的內距 */
        .brand-byline { font-size: 0.85rem; gap: 0.45rem; }   /* v130 */
        .brand-byline .line { width: 1.8rem; }
        .seo-guide { padding-top: 1rem; }
        .three-pillars { gap: 0.8rem; }
        .pillar { font-size: 0.75rem; }
        .mode-card { min-width: 0; max-width: none; padding: 1rem 0.45rem; }
        .mode-icon { font-size: clamp(0.95rem, 5vw, 1.45rem); }   /* v124：三人聊的 5 個圖示在 320px 寬也排得下一行 */
        .mode-name { font-size: 1rem; }
        .message-input-area .primary-btn { padding: 0.6rem 0.8rem !important; }
        .compact-bar { padding: 0.55rem 0.8rem; }
        .compact-bar .left-side { font-size: 0.9rem; }
    }
    /* v32：訊息區填滿可用高度，工具列不再保留大塊空白。 */
    body.in-chat .compact-bar {
        top: var(--chat-top, 0px); padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px;
        min-height: 44px;
    }
    body.in-chat .chat-main-area {
        --chat-side-padding: 8px;
        position: fixed; left: 0; right: 0; top: var(--chat-top, 0px);
        height: var(--chat-height, 100vh);
        height: var(--chat-height, 100dvh); max-width: none !important;
        padding: calc(var(--chat-bar-height, 48px) + 4px)
            max(var(--chat-side-padding), env(safe-area-inset-right, 0px))
            max(6px, env(safe-area-inset-bottom, 0px))
            max(var(--chat-side-padding), env(safe-area-inset-left, 0px)) !important;
        display: flex; flex-direction: column; align-items: stretch; gap: 4px;
        box-sizing: border-box; overflow: hidden;
    }
    body.in-chat .chat-main-area > * { flex-shrink: 0; }
    body.in-chat.chat-short-viewport .chat-main-area { padding-bottom: 6px !important; }
    body.in-chat.chat-short-viewport .typing-area { display: none !important; }
    body.in-chat.chat-short-viewport .quick-sticker-area,
    body.in-chat.chat-short-viewport .chat-reply-preview,
    body.in-chat.chat-short-viewport .mention-bar,
    body.in-chat.chat-short-viewport .trio-refill-actions,
    body.in-chat.chat-short-viewport .maintenance-notice,
    body.in-chat.chat-short-viewport .sticker-panel {
        flex-shrink: 1; min-height: 0; overflow-y: auto;
    }
    /* 鍵盤上方連工具列與輸入列都放不下時，暫時收起工具列及附加區域。 */
    body.in-chat.chat-tiny-viewport .compact-bar,
    body.in-chat.chat-tiny-viewport .quick-sticker-area,
    body.in-chat.chat-tiny-viewport .chat-reply-preview,
    body.in-chat.chat-tiny-viewport .mention-bar,
    body.in-chat.chat-tiny-viewport .trio-refill-actions,
    body.in-chat.chat-tiny-viewport .maintenance-notice,
    body.in-chat.chat-tiny-viewport .sticker-panel { display: none !important; }
    body.in-chat.chat-tiny-viewport .chat-main-area {
        --chat-side-padding: 5px;
        padding-top: 0 !important; padding-bottom: 0 !important; gap: 0;
    }
    /* v71：整個聊天畫面點兩下不放大（不會再卡在放大的畫面）；manipulation 仍保留兩指縮放與捲動。 */
    body.in-chat, body.in-chat .compact-bar, body.in-chat .chat-main-area { touch-action: manipulation; }
    body.in-chat .chat-wrapper { flex: 1 1 0 !important; min-height: 0; overflow: hidden; }
    body.in-chat .chat-window { border-radius: 14px !important; padding: 0 !important; }
    body.in-chat .chat-window .q-scrollarea__content { padding: 8px 10px; gap: 2px; align-items: stretch; justify-content: flex-start; }
    body.in-chat .chat-window .nicegui-column { gap: 2px; justify-content: flex-start; }
    body.in-chat .intro-msg-wrapper { margin: 2px 0; }
    body.in-chat .intro-msg { padding: 4px 10px; font-size: 0.76rem; }
    body.in-chat .intro-avatar { margin: 2px 0 3px; }
    body.in-chat .intro-avatar-img { width: 46px; height: 46px; }
    body.in-chat .system-msg { margin: 2px auto; padding: 3px 8px; font-size: 0.72rem; }
    body.in-chat .msg-row { margin: 4px 0; }
    body.in-chat .msg-content { max-width: 82%; }
    .quick-sticker-area { margin: 0 !important; padding: 0 3px; gap: 6px !important; }   /* v145：按鈕列和下面那一列多留點空 */
    .quick-sticker-area > .q-row { min-height: 24px; }
    /* v154：「常用訊息」那一列：左邊收合鈕、正中間「管理常用訊息」、右邊密語倒數。
       左右兩欄一樣寬，中間那欄就在正中間；倒數不見時，管理鈕也不會跑掉。 */
    .quick-sticker-area > .quick-toolbar {
        display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
        grid-template-areas: "toggle manage pill"; align-items: center; gap: 4px; min-height: 24px;
    }
    .quick-toolbar > .quick-edit-btn { grid-area: toggle; justify-self: start; }
    .quick-toolbar > .quick-manage-btn { grid-area: manage; justify-self: center; }
    .quick-toolbar > .quick-toolbar-pill { grid-area: pill; justify-self: end; }
    /* 手機直放：三個放不下同一行又要置中，第一行左邊「常用訊息」、右邊倒數，第二行「管理常用訊息」置中。 */
    @media (max-width: 480px) {
        .quick-sticker-area > .quick-toolbar { grid-template-columns: 1fr auto; grid-template-areas: "toggle pill" "manage manage"; }
    }
    .quick-sticker-scroll { padding: 2px 0 !important; margin: 0 !important; }
    .typing-area { padding: 0 4px; }
    .typing-indicator-row { min-height: 20px; padding: 0; }
    .typing-bubble { padding: 2px 8px; }
    body.in-chat .message-input-area { gap: 6px !important; }
    body.in-chat .message-input-area > .q-btn { min-width: 40px; height: 40px; padding: 6px !important; border-radius: 12px !important; }
    body.in-chat .message-input-area .primary-btn { padding: 6px 14px !important; }
    .chat-media-menu { min-width: 156px; padding: 4px; border: 1px solid #535a80; border-radius: 12px;
        background: #181d39; color: #f1f5f9; }
    .chat-media-menu .q-btn { min-height: 44px; border-radius: 8px; }
    .chat-media-menu .q-btn__content { justify-content: flex-start; }
    .chat-media-menu .video-locked { color: #aab1c8 !important; }
    .voice-message { display: flex; flex-direction: column; gap: 3px; white-space: normal; }
    .voice-message > span { font-size: 0.75rem; color: #c4b5fd; }
    .voice-message audio { width: clamp(160px, 52vw, 280px); max-width: 100%; height: 36px; }
    .video-message { width: min(260px, 100%); display: grid; gap: 4px; white-space: normal; }
    .video-message video { display: block; width: 100%; max-height: min(280px, 40vh); }
    .video-message video[hidden] { display: none; }
    .video-play-status { display: block; font-size: 0.75rem; }
    .video-play-status:empty { display: none; }
    .video-upload-form { display: grid; gap: 8px; }
    .video-upload-form input { max-width: 100%; }
    .video-upload-form p { margin: 0; color: #cbd5e1; }
    /* v106：三人聊天的「對誰說」與訊息上的 @ 標記 */
    .mention-bar { padding: 0 3px; }
    .mention-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px 0; }
    .mention-row::-webkit-scrollbar { display: none; }
    .mention-title { flex-shrink: 0; font-size: 0.75rem; color: #94a3b8; }
    .mention-pill {
        appearance: none; -webkit-appearance: none; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
        height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid #535a80; background: #1b1f44;
        color: #e2e8f0; font: inherit; font-size: 0.8rem; line-height: 1; cursor: pointer; touch-action: manipulation;
    }
    .mention-pill img { width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; background: rgba(255,255,255,0.08); }
    .mention-pill span { color: var(--mention-color, #e2e8f0); font-weight: 700; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mention-pill[aria-pressed="true"] { background: #4c4aa8; border-color: #c4b5fd; color: #fff; }
    .mention-pill:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    .msg-mention { font-size: 0.75rem; font-weight: 800; line-height: 1.3; margin-bottom: 2px; white-space: normal; }
    .msg-mention-me { color: #fbbf24; }
    .msg-bubble.msg-to-me { border-color: rgba(251,191,36,0.8); box-shadow: 0 0 0 1px rgba(251,191,36,0.35); }
    @media (max-width: 380px) {
        body.in-chat .message-input-area { gap: 4px !important; }
        body.in-chat .message-input-area > .q-btn { min-width: 36px; }
    }
    .voice-card { background: #131838; border: 1px solid #535a80; border-radius: 20px; width: min(420px, 92vw); padding: 20px; gap: 12px; }
    .voice-recorder { width: 100%; }
    #voice-status { padding: 14px 8px; text-align: center; color: #ddd6fe; min-height: 65px; font-size: 0.9rem; }
    #voice-preview { width: 100%; height: 42px; margin: 6px 0 14px; }
    .voice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .voice-action { padding: 10px; border-radius: 12px; background: #27264b; color: #e9e5ff; border: 1px solid #626187; font: inherit; cursor: pointer; }
    .voice-action:disabled { opacity: 0.4; cursor: not-allowed; }
    .voice-action:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
    .voice-primary { grid-column: 1 / -1; background: #6462cb; }
    @media (max-width: 560px) {
        body.in-chat .compact-bar { padding-left: 8px; padding-right: 8px; }
        body.in-chat .chat-main-area { --chat-side-padding: 5px; }
        body.in-chat .message-input-area .q-btn .on-left { margin-right: 0; }
        /* 手機只顯示傳送圖示；Quasar 的 .block 有 display:block !important，改用螢幕閱讀器專用的隱藏方式。 */
        body.in-chat .message-input-area .primary-btn .block {
            position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
            overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
        }
        body.in-chat .message-input-area .primary-btn { padding: 6px 12px !important; }
        body.in-chat .msg-bubble { padding: 7px 10px; }
        /* 手機 GPU 較弱：聊天時拿掉大面積背景模糊，改用接近的半透明底色。 */
        body.in-chat .chat-window { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(15,23,42,0.72) !important; }
        body.in-chat .compact-bar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10,14,39,0.94); }
        body.in-chat .typing-bubble { backdrop-filter: none; -webkit-backdrop-filter: none; }
    }
    /* v35：自訂背景加深色遮罩，讓亮色選擇仍保有文字對比。預設漸層保持原樣。 */
    html[data-tt-background="custom"] body { background: var(--tt-background-color); }
    html[data-tt-background="custom"] .app-bg {
        background: linear-gradient(rgba(7,11,26,var(--tt-background-shade,0.82)), rgba(7,11,26,var(--tt-background-shade,0.82))), var(--tt-background-color);
    }
    html[data-tt-background="custom"] .orb { display: none; }

    /* ==== v109：10 款背景風格，全部是暗色，全部用 CSS 畫（v107 的 5 款亮色已拿掉，換成 6～10 號）。
       <html data-tt-background="aurora" data-tt-tone="dark">，由 window._threeTalkAppearance.apply() 設定。 ==== */
html[data-tt-background="aurora"] .orb,
html[data-tt-background="stars"] .orb,
html[data-tt-background="dusk"] .orb,
html[data-tt-background="neon"] .orb,
html[data-tt-background="seigaiha"] .orb,
html[data-tt-background="abyss"] .orb,
html[data-tt-background="yozakura"] .orb,
html[data-tt-background="firefly"] .orb,
html[data-tt-background="bokeh"] .orb,
html[data-tt-background="ink"] .orb,
html[data-tt-background="maple"] .orb,
html[data-tt-background="snow"] .orb,
html[data-tt-background="fireworks"] .orb,
html[data-tt-background="rain"] .orb,
html[data-tt-background="bamboo"] .orb { display: none; }

html[data-tt-background="aurora"] .app-bg::before,
html[data-tt-background="aurora"] .app-bg::after,
html[data-tt-background="stars"] .app-bg::before,
html[data-tt-background="stars"] .app-bg::after,
html[data-tt-background="dusk"] .app-bg::before,
html[data-tt-background="dusk"] .app-bg::after,
html[data-tt-background="neon"] .app-bg::before,
html[data-tt-background="neon"] .app-bg::after,
html[data-tt-background="seigaiha"] .app-bg::before,
html[data-tt-background="seigaiha"] .app-bg::after,
html[data-tt-background="abyss"] .app-bg::before,
html[data-tt-background="abyss"] .app-bg::after,
html[data-tt-background="yozakura"] .app-bg::before,
html[data-tt-background="yozakura"] .app-bg::after,
html[data-tt-background="firefly"] .app-bg::before,
html[data-tt-background="firefly"] .app-bg::after,
html[data-tt-background="bokeh"] .app-bg::before,
html[data-tt-background="bokeh"] .app-bg::after,
html[data-tt-background="ink"] .app-bg::before,
html[data-tt-background="ink"] .app-bg::after,
html[data-tt-background="maple"] .app-bg::before,
html[data-tt-background="maple"] .app-bg::after,
html[data-tt-background="snow"] .app-bg::before,
html[data-tt-background="snow"] .app-bg::after,
html[data-tt-background="fireworks"] .app-bg::before,
html[data-tt-background="fireworks"] .app-bg::after,
html[data-tt-background="rain"] .app-bg::before,
html[data-tt-background="rain"] .app-bg::after,
html[data-tt-background="bamboo"] .app-bg::before,
html[data-tt-background="bamboo"] .app-bg::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
}
html[data-tt-tone] .app-bg { overflow: hidden; }

/* 1. 極光：深夜藍底，上方飄著綠、青、紫的光帶 */
html[data-tt-background="aurora"] body { background: #04101c; }
html[data-tt-background="aurora"] .app-bg {
    background:
        radial-gradient(140% 55% at 50% 118%, rgba(16,185,129,0.20) 0%, transparent 60%),
        linear-gradient(180deg, #030b16 0%, #06182a 48%, #04101c 100%);
}
html[data-tt-background="aurora"] .app-bg::before {
    inset: -20% -30% 35% -30%;
    background:
        radial-gradient(40% 44% at 24% 50%, rgba(52,211,153,0.70) 0%, transparent 70%),
        radial-gradient(30% 38% at 50% 38%, rgba(45,212,191,0.55) 0%, transparent 70%),
        radial-gradient(36% 42% at 76% 48%, rgba(167,139,250,0.60) 0%, transparent 70%),
        radial-gradient(22% 30% at 94% 32%, rgba(236,72,153,0.38) 0%, transparent 70%);
    filter: blur(38px);
    transform: skewY(-8deg);
    animation: tt-aurora 26s ease-in-out infinite alternate;
}
html[data-tt-background="aurora"] .app-bg::after {
    /* 光帶裡細細的直條紋，像極光的簾幕 */
    inset: 0 0 45% 0;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 3px, transparent 3px 17px);
    filter: blur(1.5px);
    mask-image: linear-gradient(180deg, transparent 0%, #000 35%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%, transparent 100%);
}
@keyframes tt-aurora {
    0%   { transform: skewY(-8deg) translateX(-4%); }
    100% { transform: skewY(-5deg) translateX(5%) scaleY(1.08); }
}

/* 2. 星空：藍紫夜空，三種大小的星星，一條淡淡的銀河 */
html[data-tt-background="stars"] body { background: #070a1f; }
html[data-tt-background="stars"] .app-bg {
    background:
        radial-gradient(1.2px 1.2px at 12px 18px, rgba(255,255,255,0.85) 98%, transparent) 0 0 / 97px 89px,
        radial-gradient(1px 1px at 41px 63px, rgba(191,219,254,0.70) 98%, transparent) 0 0 / 131px 113px,
        radial-gradient(1.6px 1.6px at 77px 29px, rgba(255,255,255,0.90) 98%, transparent) 0 0 / 223px 197px,
        radial-gradient(2.2px 2.2px at 150px 120px, rgba(253,230,138,0.80) 98%, transparent) 0 0 / 389px 331px,
        radial-gradient(120% 80% at 50% 120%, #1e1b4b 0%, transparent 60%),
        linear-gradient(180deg, #050816 0%, #0b1030 55%, #12123a 100%);
}
html[data-tt-background="stars"] .app-bg::before {
    /* 銀河：斜斜的一條霧 */
    inset: -30%;
    background:
        linear-gradient(120deg, transparent 38%, rgba(167,139,250,0.16) 46%, rgba(255,255,255,0.10) 50%,
                        rgba(96,165,250,0.14) 54%, transparent 62%);
    filter: blur(24px);
}
html[data-tt-background="stars"] .app-bg::after {
    /* 會慢慢閃爍的亮星 */
    background:
        radial-gradient(2px 2px at 60px 40px, #fff 98%, transparent) 0 0 / 311px 277px,
        radial-gradient(2.4px 2.4px at 200px 160px, #e0e7ff 98%, transparent) 0 0 / 457px 401px;
    animation: tt-twinkle 5s ease-in-out infinite alternate;
}
@keyframes tt-twinkle { 0% { opacity: 0.25; } 100% { opacity: 1; } }

/* 3. 晚霞（v148 重畫）：沒有地平線和遠山。上面是深靛藍，往下慢慢變成玫瑰紫和珊瑚橘，
   右下角是快下山的太陽的光暈，幾朵被照亮的雲慢慢飄，上方還有幾顆早出的星星 */
html[data-tt-background="dusk"] body { background: #1a0f2e; }
html[data-tt-background="dusk"] .app-bg {
    background:
        radial-gradient(120% 38% at 50% 112%, rgba(20,9,30,0.82) 0%, rgba(20,9,30,0.45) 45%, transparent 75%),
        radial-gradient(circle at 82% 80%, rgba(254,215,170,0.42) 0, rgba(251,146,60,0.30) 8%, rgba(244,63,94,0.14) 22%, transparent 40%),
        radial-gradient(1.2px 1.2px at 30px 24px, rgba(255,255,255,0.75) 98%, transparent) 0 0 / 151px 133px,
        radial-gradient(1px 1px at 90px 70px, rgba(254,226,226,0.6) 98%, transparent) 0 0 / 211px 173px,
        linear-gradient(180deg, #0b0a24 0%, #1d1446 24%, #3a1c5c 44%, #5f255e 60%, #7c2d55 74%, #6a2649 86%, #3e1736 100%);
}
html[data-tt-background="dusk"] .app-bg::before {
    /* 被夕陽照亮的雲：一朵朵圓圓的、糊糊的，不拉成橫條 */
    inset: -10%;
    background:
        radial-gradient(18% 9% at 22% 58%, rgba(251,146,60,0.30) 0%, transparent 70%),
        radial-gradient(12% 7% at 30% 55%, rgba(254,205,211,0.24) 0%, transparent 70%),
        radial-gradient(20% 10% at 70% 46%, rgba(244,114,182,0.26) 0%, transparent 70%),
        radial-gradient(13% 7% at 80% 49%, rgba(253,186,116,0.24) 0%, transparent 70%),
        radial-gradient(16% 8% at 46% 74%, rgba(251,113,133,0.24) 0%, transparent 70%),
        radial-gradient(10% 6% at 12% 80%, rgba(253,186,116,0.22) 0%, transparent 70%),
        radial-gradient(14% 8% at 88% 72%, rgba(251,146,60,0.22) 0%, transparent 70%);
    filter: blur(10px);
    animation: tt-dusk-clouds 40s ease-in-out infinite alternate;
}
html[data-tt-background="dusk"] .app-bg::after {
    /* 太陽四周一層暖暖的霞光 */
    background: radial-gradient(60% 36% at 82% 80%, rgba(251,146,60,0.16) 0%, transparent 70%);
}
@keyframes tt-dusk-clouds { 0% { transform: translateX(-3%); } 100% { transform: translateX(3%); } }

/* 4. 霓虹網格（v148 重畫）：沒有地平線，格線改成斜的菱形網格；左下粉紅、右上青色的霓虹光，整片網格慢慢斜斜地移動 */
html[data-tt-background="neon"] body { background: #0d0620; }
html[data-tt-background="neon"] .app-bg {
    background:
        radial-gradient(60% 45% at 0% 100%, rgba(236,72,153,0.32) 0%, transparent 70%),
        radial-gradient(55% 40% at 100% 0%, rgba(34,211,238,0.24) 0%, transparent 70%),
        radial-gradient(50% 35% at 60% 55%, rgba(139,92,246,0.18) 0%, transparent 70%),
        linear-gradient(160deg, #0a0420 0%, #150a36 50%, #0b0418 100%);
}
html[data-tt-background="neon"] .app-bg::before {
    /* 斜的菱形格線（60° 和 120°），沒有任何一條是橫的；整片斜斜地移動，移一格剛好接回原位 */
    inset: -120px;
    background:
        repeating-linear-gradient(60deg, rgba(232,121,249,0.42) 0 1.5px, transparent 1.5px 46px),
        repeating-linear-gradient(120deg, rgba(103,232,249,0.36) 0 1.5px, transparent 1.5px 46px);
    filter: drop-shadow(0 0 3px rgba(232,121,249,0.6));
    opacity: 0.42;
    animation: tt-neon-drift 24s linear infinite;
}
html[data-tt-background="neon"] .app-bg::after {
    /* 格線上幾顆發亮的光點，四周暗一點，中間的格線比較明顯 */
    background:
        radial-gradient(circle at 18% 30%, rgba(240,171,252,0.9) 0 2px, rgba(240,171,252,0.25) 5px, transparent 12px),
        radial-gradient(circle at 76% 22%, rgba(103,232,249,0.9) 0 2px, rgba(103,232,249,0.25) 5px, transparent 12px),
        radial-gradient(circle at 62% 70%, rgba(240,171,252,0.85) 0 2px, rgba(240,171,252,0.22) 5px, transparent 12px),
        radial-gradient(circle at 30% 82%, rgba(103,232,249,0.85) 0 2px, rgba(103,232,249,0.22) 5px, transparent 12px),
        radial-gradient(80% 70% at 50% 50%, transparent 45%, rgba(8,3,24,0.70) 100%);
}
@keyframes tt-neon-drift { from { transform: translate(0, 0); } to { transform: translate(0, -92px); } }

/* 5. 青海波：日式的扇形海浪花紋，深藍綠色，低調有質感 */
html[data-tt-background="seigaiha"] body { background: #0a1f24; }
html[data-tt-background="seigaiha"] .app-bg {
    --wave: rgba(94,234,212,0.13);
    --gap: #0b2329;
    background:
        radial-gradient(circle at 50% 100%, var(--gap) 18%, var(--wave) 19% 22%, var(--gap) 23% 33%, var(--wave) 34% 37%,
                        var(--gap) 38% 48%, var(--wave) 49% 52%, transparent 53%) 0 0 / 64px 32px,
        radial-gradient(circle at 50% 100%, var(--gap) 18%, var(--wave) 19% 22%, var(--gap) 23% 33%, var(--wave) 34% 37%,
                        var(--gap) 38% 48%, var(--wave) 49% 52%, transparent 53%) 32px 16px / 64px 32px,
        #0b2329;
}
html[data-tt-background="seigaiha"] .app-bg::before {
    /* 四周暗一點、中間透一點光 */
    background: radial-gradient(80% 70% at 50% 40%, rgba(45,212,191,0.10) 0%, transparent 60%),
                radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(2,8,12,0.55) 100%);
}


/* 6. 深海：越往下越深的藍，從水面斜斜照下來的光束，慢慢往上冒的小氣泡 */
html[data-tt-background="abyss"] body { background: #020b1a; }
html[data-tt-background="abyss"] .app-bg {
    background:
        radial-gradient(90% 38% at 50% -6%, rgba(56,189,248,0.30) 0%, transparent 70%),
        radial-gradient(70% 40% at 50% 112%, rgba(8,47,73,0.55) 0%, transparent 70%),
        linear-gradient(180deg, #0b2d4f 0%, #07223d 20%, #04172d 52%, #020b1a 100%);
}
html[data-tt-background="abyss"] .app-bg::before {
    /* 光束 */
    inset: -8% -25% 25% -25%;
    background:
        linear-gradient(103deg, transparent 18%, rgba(125,211,252,0.17) 22%, transparent 27%),
        linear-gradient(80deg, transparent 38%, rgba(186,230,253,0.19) 44%, transparent 50%),
        linear-gradient(97deg, transparent 57%, rgba(125,211,252,0.14) 61%, transparent 66%),
        linear-gradient(84deg, transparent 74%, rgba(125,211,252,0.15) 79%, transparent 85%);
    filter: blur(4px);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.6) 45%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.6) 45%, transparent 100%);
    animation: tt-abyss-rays 16s ease-in-out infinite alternate;
}
html[data-tt-background="abyss"] .app-bg::after {
    /* 氣泡：三種大小，每一層的高度都是 240px，往上移 240px 剛好接回原位 */
    top: 0; bottom: -240px;
    background:
        radial-gradient(circle at 34px 60px, transparent 2.6px, rgba(186,230,253,0.50) 3px, transparent 4px) 0 0 / 181px 240px,
        radial-gradient(circle at 110px 170px, transparent 1.6px, rgba(186,230,253,0.40) 2px, transparent 2.8px) 0 0 / 139px 240px,
        radial-gradient(circle at 70px 30px, rgba(224,242,254,0.35) 1.1px, transparent 1.7px) 0 0 / 97px 120px;
    opacity: 0.85;
    animation: tt-abyss-bubbles 28s linear infinite;
}
@keyframes tt-abyss-rays {
    0%   { transform: translateX(-3%) skewX(-2deg); opacity: 0.75; }
    100% { transform: translateX(3%) skewX(2deg); opacity: 1; }
}
@keyframes tt-abyss-bubbles { from { transform: translateY(0); } to { transform: translateY(-240px); } }

/* 7. 夜櫻：深紫紅的夜，右上角一輪淡粉色的月亮，左上角的櫻花團，飄落的花瓣 */
html[data-tt-background="yozakura"] body { background: #12081a; }
html[data-tt-background="yozakura"] .app-bg {
    background:
        radial-gradient(circle at 88% 5%, rgba(255,241,242,0.88) 0, rgba(254,205,211,0.60) 28px, rgba(244,114,182,0.14) 64px, transparent 140px),
        radial-gradient(90% 55% at 12% 0%, rgba(131,24,67,0.40) 0%, transparent 62%),
        radial-gradient(100% 70% at 100% 100%, rgba(76,29,149,0.38) 0%, transparent 62%),
        linear-gradient(170deg, #1d0c27 0%, #170a21 50%, #0d0614 100%);
}
html[data-tt-background="yozakura"] .app-bg::before {
    /* 左上角一團團的櫻花，糊糊的像在夜裡被燈照亮 */
    background:
        radial-gradient(26% 18% at 0% 0%, rgba(244,114,182,0.38) 0%, transparent 70%),
        radial-gradient(14% 10% at 16% 5%, rgba(251,207,232,0.30) 0%, transparent 70%),
        radial-gradient(18% 12% at 5% 17%, rgba(236,72,153,0.26) 0%, transparent 70%),
        radial-gradient(10% 7% at 25% 12%, rgba(253,164,175,0.24) 0%, transparent 70%),
        radial-gradient(16% 10% at 100% 96%, rgba(244,114,182,0.16) 0%, transparent 70%);
    filter: blur(6px);
}
html[data-tt-background="yozakura"] .app-bg::after {
    /* 花瓣：斜斜的小橢圓；每一層的高度都是 130px，往下移 130px 剛好接回原位 */
    inset: -45%;
    background:
        radial-gradient(7px 4px at 22px 26px, rgba(251,182,206,0.62) 70%, transparent 76%) 0 0 / 157px 130px,
        radial-gradient(5px 3px at 96px 84px, rgba(244,114,182,0.50) 70%, transparent 76%) 0 0 / 193px 130px,
        radial-gradient(6px 3.5px at 54px 44px, rgba(253,164,175,0.45) 70%, transparent 76%) 75px 65px / 229px 130px,
        radial-gradient(4px 2.5px at 130px 100px, rgba(251,207,232,0.42) 70%, transparent 76%) 31px 0 / 271px 130px,
        radial-gradient(6px 3.5px at 12px 112px, rgba(236,72,153,0.38) 70%, transparent 76%) 0 47px / 311px 130px;
    transform: rotate(-24deg);   /* 開啟「減少動態效果」時花瓣停住，也是斜的 */
    animation: tt-yozakura 20s linear infinite;
}
@keyframes tt-yozakura {
    from { transform: rotate(-24deg) translateY(-130px); }
    to   { transform: rotate(-24deg) translateY(0); }
}

/* 8. 螢火蟲：深綠色的夏夜森林，下方是暗色的草叢，兩群螢火蟲輪流亮起來 */
html[data-tt-background="firefly"] body { background: #03100b; }
html[data-tt-background="firefly"] .app-bg {
    background:
        radial-gradient(34% 22% at 6% 100%, #020a06 98%, transparent 100%),
        radial-gradient(30% 16% at 38% 100%, #030c08 98%, transparent 100%),
        radial-gradient(36% 20% at 74% 100%, #020a06 98%, transparent 100%),
        radial-gradient(24% 15% at 102% 100%, #030c08 98%, transparent 100%),
        radial-gradient(120% 45% at 50% 108%, rgba(22,101,52,0.55) 0%, transparent 62%),
        radial-gradient(80% 45% at 50% -10%, rgba(30,58,138,0.28) 0%, transparent 70%),
        linear-gradient(180deg, #060f1c 0%, #06170f 46%, #04110b 100%);
}
html[data-tt-background="firefly"] .app-bg::before,
html[data-tt-background="firefly"] .app-bg::after {
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.5) 20%, #000 55%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.5) 20%, #000 55%);
}
html[data-tt-background="firefly"] .app-bg::before {
    /* 每一層的格子大小都不一樣、每格放兩隻在不同位置，看起來才不會排成一格一格 */
    background:
        radial-gradient(circle at 40px 60px, rgba(236,252,203,1) 0 1.8px, rgba(190,242,100,0.55) 3.4px, transparent 11px) 0 0 / 283px 241px,
        radial-gradient(circle at 190px 170px, rgba(217,249,157,0.95) 0 1.4px, rgba(163,230,53,0.48) 2.8px, transparent 9px) 0 0 / 283px 241px,
        radial-gradient(circle at 120px 30px, rgba(217,249,157,0.95) 0 1.5px, rgba(163,230,53,0.48) 3px, transparent 9px) 0 0 / 367px 307px,
        radial-gradient(circle at 300px 230px, rgba(254,249,195,1) 0 1.9px, rgba(250,204,21,0.50) 3.6px, transparent 12px) 0 0 / 367px 307px;
    animation: tt-firefly 3.8s ease-in-out infinite alternate;
}
html[data-tt-background="firefly"] .app-bg::after {
    background:
        radial-gradient(circle at 90px 110px, rgba(254,249,195,1) 0 2px, rgba(250,204,21,0.50) 3.8px, transparent 12px) 0 0 / 331px 277px,
        radial-gradient(circle at 250px 40px, rgba(236,252,203,1) 0 1.3px, rgba(190,242,100,0.55) 2.6px, transparent 8px) 0 0 / 331px 277px,
        radial-gradient(circle at 20px 200px, rgba(236,252,203,1) 0 1.6px, rgba(190,242,100,0.55) 3.2px, transparent 10px) 0 0 / 257px 349px,
        radial-gradient(circle at 170px 300px, rgba(217,249,157,0.95) 0 1.4px, rgba(163,230,53,0.48) 2.8px, transparent 9px) 0 0 / 257px 349px;
    animation: tt-firefly 4.6s ease-in-out -2.3s infinite alternate;
}
@keyframes tt-firefly {
    0%   { opacity: 0.15; transform: translate(0, 0); }
    100% { opacity: 1;    transform: translate(6px, -8px); }
}

/* 9. 暖光散景：深咖啡色的夜，像相機失焦時看到的街燈，一顆顆大大的暖色光圈 */
html[data-tt-background="bokeh"] body { background: #110a08; }
html[data-tt-background="bokeh"] .app-bg {
    background:
        radial-gradient(100% 55% at 50% 112%, rgba(124,45,18,0.40) 0%, transparent 62%),
        radial-gradient(80% 50% at 0% 0%, rgba(76,29,149,0.18) 0%, transparent 62%),
        linear-gradient(180deg, #120c12 0%, #1a100c 55%, #110a08 100%);
}
html[data-tt-background="bokeh"] .app-bg::before {
    /* 大光圈：中間淡、邊緣亮一點，才像真的散景 */
    inset: -6%;
    background:
        radial-gradient(circle at 12% 20%, rgba(251,191,36,0.20) 0 30px, rgba(251,191,36,0.34) 33px, transparent 35px),
        radial-gradient(circle at 80% 12%, rgba(251,146,60,0.18) 0 48px, rgba(251,146,60,0.30) 51px, transparent 53px),
        radial-gradient(circle at 60% 38%, rgba(244,114,182,0.14) 0 26px, rgba(244,114,182,0.24) 29px, transparent 31px),
        radial-gradient(circle at 24% 58%, rgba(253,186,116,0.16) 0 40px, rgba(253,186,116,0.28) 43px, transparent 45px),
        radial-gradient(circle at 90% 62%, rgba(251,191,36,0.18) 0 36px, rgba(251,191,36,0.30) 39px, transparent 41px),
        radial-gradient(circle at 46% 84%, rgba(249,115,22,0.16) 0 54px, rgba(249,115,22,0.26) 57px, transparent 59px),
        radial-gradient(circle at 6% 90%, rgba(244,114,182,0.14) 0 28px, rgba(244,114,182,0.22) 31px, transparent 33px),
        radial-gradient(circle at 70% 96%, rgba(254,215,170,0.14) 0 22px, rgba(254,215,170,0.24) 25px, transparent 27px);
    filter: blur(2.5px);
    animation: tt-bokeh 26s ease-in-out infinite alternate;
}
html[data-tt-background="bokeh"] .app-bg::after {
    /* 遠一點的小光點 */
    background:
        radial-gradient(circle at 24px 32px, rgba(254,215,170,0.34) 0 5px, transparent 6.5px) 0 0 / 157px 139px,
        radial-gradient(circle at 96px 86px, rgba(251,146,60,0.26) 0 8px, transparent 9.5px) 0 0 / 223px 181px,
        radial-gradient(circle at 60px 20px, rgba(244,114,182,0.22) 0 4px, transparent 5.5px) 0 0 / 113px 167px;
    filter: blur(1.5px);
    animation: tt-twinkle 7s ease-in-out infinite alternate;
}
@keyframes tt-bokeh {
    0%   { transform: translate(-1.5%, 1%) scale(1); }
    100% { transform: translate(1.5%, -1%) scale(1.04); }
}

/* 10. 墨染：水墨畫的灰黑色，遠山一層比一層淡，山腳下有霧，右上角一顆淡淡的朱紅太陽 */
html[data-tt-background="ink"] body { background: #0c0e11; }
html[data-tt-background="ink"] .app-bg {
    background:
        radial-gradient(circle at 88% 7%, rgba(185,28,28,0.58) 0 20px, rgba(185,28,28,0.14) 26px, transparent 46px),
        radial-gradient(90% 60% at 30% 10%, rgba(148,163,184,0.10) 0%, transparent 70%),
        linear-gradient(180deg, #17191d 0%, #121418 58%, #0b0c0f 100%);
}
html[data-tt-background="ink"] .app-bg::before {
    /* 遠山：淡灰色，糊開像墨暈；山腳漸漸消失在霧裡 */
    top: 46%; bottom: 8%;
    background: url('/backgrounds/ink-far.svg?v=1') 0 0 / 100% 100% no-repeat;
    opacity: 0.20;
    filter: blur(5px);
    mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 85%);
}
html[data-tt-background="ink"] .app-bg::after {
    /* 近山：深一點；整片慢慢左右飄，像霧在動 */
    top: 62%; left: -6%; right: -6%;
    background: url('/backgrounds/ink-near.svg?v=1') 0 0 / 100% 100% no-repeat;
    opacity: 0.55;
    filter: blur(2.5px);
    mask-image: linear-gradient(180deg, #000 0%, #000 35%, rgba(0,0,0,0.25) 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, rgba(0,0,0,0.25) 80%, transparent 100%);
    animation: tt-ink-mist 30s ease-in-out infinite alternate;
}
@keyframes tt-ink-mist { 0% { transform: translateX(-2%); } 100% { transform: translateX(2%); } }

/* 11. 楓紅（v148）：深紅褐色的秋夜，右上角一盞暖暖的燈光，紅、橘、金色的楓葉慢慢飄落 */
html[data-tt-background="maple"] body { background: #160907; }
html[data-tt-background="maple"] .app-bg {
    background:
        radial-gradient(circle at 86% 8%, rgba(254,215,170,0.30) 0, rgba(251,146,60,0.18) 60px, transparent 200px),
        radial-gradient(90% 55% at 0% 100%, rgba(127,29,29,0.40) 0%, transparent 65%),
        radial-gradient(70% 50% at 100% 60%, rgba(124,45,18,0.30) 0%, transparent 65%),
        linear-gradient(170deg, #1f0d0a 0%, #170907 55%, #0e0604 100%);
}
html[data-tt-background="maple"] .app-bg::before {
    /* 遠的小楓葉：糊一點、飄得慢 */
    inset: -45%;
    background: url('/backgrounds/maple-far.svg?v=1') 0 0 / 200px 220px;
    filter: blur(1.5px);
    transform: rotate(-18deg);
    animation: tt-maple-far 34s linear infinite;
}
html[data-tt-background="maple"] .app-bg::after {
    /* 近的大楓葉 */
    inset: -45%;
    background: url('/backgrounds/maple-near.svg?v=1') 0 0 / 260px 300px;
    transform: rotate(-18deg);
    animation: tt-maple-near 22s linear infinite;
}
@keyframes tt-maple-far { from { transform: rotate(-18deg) translateY(-220px); } to { transform: rotate(-18deg) translateY(0); } }
@keyframes tt-maple-near { from { transform: rotate(-18deg) translateY(-300px); } to { transform: rotate(-18deg) translateY(0); } }

/* 12. 雪夜（v148）：深藍色的冬夜，左上角一輪淡淡的月光，大大小小的雪花慢慢飄下來 */
html[data-tt-background="snow"] body { background: #060b1a; }
html[data-tt-background="snow"] .app-bg {
    background:
        radial-gradient(circle at 14% 6%, rgba(241,245,249,0.85) 0 22px, rgba(186,230,253,0.28) 30px, rgba(186,230,253,0.08) 90px, transparent 180px),
        radial-gradient(100% 60% at 50% 110%, rgba(30,58,138,0.40) 0%, transparent 65%),
        linear-gradient(180deg, #070c1d 0%, #0b1530 55%, #0d1a36 100%);
}
html[data-tt-background="snow"] .app-bg::before {
    /* 遠的小雪：每一層的高度都是 200px，往下移 200px 剛好接回原位 */
    top: -200px;
    background:
        radial-gradient(circle at 20px 30px, rgba(255,255,255,0.75) 0 1.2px, transparent 2px) 0 0 / 97px 200px,
        radial-gradient(circle at 70px 120px, rgba(224,242,254,0.65) 0 1px, transparent 1.8px) 0 0 / 131px 200px,
        radial-gradient(circle at 40px 170px, rgba(255,255,255,0.6) 0 1.4px, transparent 2.2px) 0 0 / 173px 200px;
    animation: tt-snow-far 18s linear infinite;
}
html[data-tt-background="snow"] .app-bg::after {
    /* 近的大雪：糊一點、飄得快，也會左右晃 */
    top: -260px; left: -40px; right: -40px;
    background:
        radial-gradient(circle at 60px 50px, rgba(255,255,255,0.85) 0 2.6px, rgba(255,255,255,0.3) 3.6px, transparent 5px) 0 0 / 211px 260px,
        radial-gradient(circle at 160px 190px, rgba(241,245,249,0.75) 0 2px, rgba(241,245,249,0.25) 3px, transparent 4.4px) 0 0 / 257px 260px,
        radial-gradient(circle at 30px 220px, rgba(255,255,255,0.7) 0 3px, rgba(255,255,255,0.22) 4px, transparent 6px) 0 0 / 313px 260px;
    filter: blur(0.6px);
    animation: tt-snow-near 11s linear infinite;
}
@keyframes tt-snow-far { from { transform: translateY(0); } to { transform: translateY(200px); } }
@keyframes tt-snow-near {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(18px, 130px); }
    100% { transform: translate(0, 260px); }
}

/* 13. 煙火（v148）：深藍紫的夜空，金、粉、青、紫、綠、橘的煙火一朵朵輪流綻放，下面帶一點煙霧的亮光 */
html[data-tt-background="fireworks"] body { background: #070616; }
html[data-tt-background="fireworks"] .app-bg {
    background:
        radial-gradient(80% 45% at 50% 105%, rgba(124,58,237,0.22) 0%, transparent 70%),
        radial-gradient(60% 40% at 15% 0%, rgba(30,64,175,0.22) 0%, transparent 70%),
        linear-gradient(180deg, #06051a 0%, #0c0a26 55%, #120d2c 100%);
}
html[data-tt-background="fireworks"] .app-bg::before {
    background: url('/backgrounds/fireworks-a.svg?v=1') 0 0 / 520px 460px;
    animation: tt-fireworks 5.2s ease-in-out infinite;
}
html[data-tt-background="fireworks"] .app-bg::after {
    background: url('/backgrounds/fireworks-b.svg?v=1') 120px 60px / 600px 540px;
    animation: tt-fireworks 5.2s ease-in-out -2.6s infinite;
}
@keyframes tt-fireworks {
    0%   { opacity: 0;    transform: scale(0.92); }
    25%  { opacity: 0.6;  transform: scale(1); }
    60%  { opacity: 0.34; transform: scale(1.03); }
    100% { opacity: 0;    transform: scale(1.05); }
}

/* 14. 雨夜（v148）：隔著下雨的玻璃窗看城市的夜，遠處糊糊的暖色和青色燈光，斜斜的雨絲，玻璃上的水珠 */
html[data-tt-background="rain"] body { background: #0a0f17; }
html[data-tt-background="rain"] .app-bg {
    background:
        radial-gradient(circle at 18% 78%, rgba(251,191,36,0.20) 0, transparent 90px),
        radial-gradient(circle at 70% 88%, rgba(45,212,191,0.16) 0, transparent 110px),
        radial-gradient(circle at 88% 64%, rgba(251,146,60,0.16) 0, transparent 80px),
        radial-gradient(circle at 42% 92%, rgba(244,114,182,0.14) 0, transparent 90px),
        radial-gradient(100% 60% at 50% 110%, rgba(30,41,59,0.70) 0%, transparent 70%),
        linear-gradient(180deg, #0b111b 0%, #0d1420 60%, #111a27 100%);
}
html[data-tt-background="rain"] .app-bg::before {
    /* 玻璃上的水珠：亮邊加一點反光 */
    background:
        radial-gradient(circle at 30px 40px, rgba(226,232,240,0.0) 0 3px, rgba(226,232,240,0.30) 3.6px, transparent 4.6px) 0 0 / 137px 151px,
        radial-gradient(circle at 90px 110px, rgba(226,232,240,0.0) 0 2px, rgba(226,232,240,0.26) 2.6px, transparent 3.4px) 0 0 / 173px 197px,
        radial-gradient(circle at 60px 20px, rgba(255,255,255,0.35) 0 1px, transparent 1.6px) 0 0 / 109px 127px;
    opacity: 0.8;
}
html[data-tt-background="rain"] .app-bg::after {
    /* 雨絲：整片斜 12 度往下落；每一層高 240px，往下移 240px 剛好接回原位 */
    inset: -30%;
    background: url('/backgrounds/rain.svg?v=1') 0 0 / 180px 240px;
    opacity: 0.42;
    transform: rotate(12deg);
    animation: tt-rain 0.9s linear infinite;
}
@keyframes tt-rain { from { transform: rotate(12deg) translateY(-240px); } to { transform: rotate(12deg) translateY(0); } }

/* 15. 竹林（v148）：月光下的竹林，遠的竹子淡淡地糊開，近的竹子深一點、跟著風輕輕搖；竹子直直的，不畫竹節 */
html[data-tt-background="bamboo"] body { background: #04100b; }
html[data-tt-background="bamboo"] .app-bg {
    background:
        radial-gradient(circle at 80% 4%, rgba(220,252,231,0.30) 0 16px, rgba(187,247,208,0.10) 60px, transparent 200px),
        radial-gradient(90% 55% at 50% 0%, rgba(20,83,45,0.35) 0%, transparent 70%),
        linear-gradient(180deg, #061a12 0%, #05140e 55%, #030c08 100%);
}
html[data-tt-background="bamboo"] .app-bg::before {
    background: url('/backgrounds/bamboo-far.svg?v=1') 0 100% / auto 100% repeat-x;
    opacity: 0.55;
    filter: blur(3px);
    mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, rgba(0,0,0,0.35) 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 70%, rgba(0,0,0,0.35) 100%);
}
html[data-tt-background="bamboo"] .app-bg::after {
    left: -4%; right: -4%;
    background: url('/backgrounds/bamboo-near.svg?v=1') 0 100% / auto 100% repeat-x;
    opacity: 0.9;
    transform-origin: 50% 100%;
    animation: tt-bamboo-sway 9s ease-in-out infinite alternate;
}
@keyframes tt-bamboo-sway { 0% { transform: rotate(-0.6deg); } 100% { transform: rotate(0.6deg); } }

@media (prefers-reduced-motion: reduce) {
    html[data-tt-background] .app-bg::before,
    html[data-tt-background] .app-bg::after { animation: none !important; }
    /* v148：煙火的亮度原本由動畫控制，動畫停掉時固定在淡淡的樣子 */
    html[data-tt-background="fireworks"] .app-bg::before,
    html[data-tt-background="fireworks"] .app-bg::after { opacity: 0.4; }
}


/* v107：閱讀與背景設定裡的背景風格小方塊（縮小版的背景）；v109：10 款排成一個 5×2 的格子；v148：15 款排成 5×3 */
.bg-style-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: 100%; }
.bg-style-tile {
    appearance: none; -webkit-appearance: none; border: 0; padding: 0; margin: 0; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
    color: #e2e8f0; font: inherit; font-size: 0.72rem; line-height: 1.2; touch-action: manipulation;
}
.bg-style-swatch {
    display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
}
.bg-style-tile[aria-pressed="true"] .bg-style-swatch { outline: 3px solid #a78bfa; outline-offset: 2px; }
.bg-style-tile[aria-pressed="true"] .bg-style-name { color: #ddd6fe; font-weight: 800; }
.bg-style-tile:focus-visible { outline: none; }
.bg-style-tile:focus-visible .bg-style-swatch { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.bg-style-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bg-swatch-aurora { background:
    radial-gradient(60% 40% at 30% 30%, rgba(52,211,153,0.85), transparent 70%),
    radial-gradient(50% 40% at 75% 35%, rgba(167,139,250,0.8), transparent 70%),
    linear-gradient(180deg, #030b16, #06182a 60%, #04101c); }
.bg-swatch-stars { background:
    radial-gradient(1.2px 1.2px at 6px 8px, #fff 98%, transparent) 0 0 / 17px 15px,
    radial-gradient(1px 1px at 11px 4px, #c7d2fe 98%, transparent) 0 0 / 23px 21px,
    linear-gradient(120deg, transparent 40%, rgba(167,139,250,0.28) 50%, transparent 60%),
    linear-gradient(180deg, #050816, #12123a); }
.bg-swatch-dusk { background:
    radial-gradient(circle at 82% 78%, rgba(254,215,170,0.85) 0, rgba(251,146,60,0.5) 12%, transparent 38%),
    radial-gradient(30% 12% at 30% 56%, rgba(251,146,60,0.45), transparent 70%),
    radial-gradient(32% 12% at 70% 44%, rgba(244,114,182,0.45), transparent 70%),
    linear-gradient(180deg, #0b0a24 0%, #3a1c5c 42%, #7c2d55 72%, #3e1736 100%); }
.bg-swatch-neon { background:
    repeating-linear-gradient(60deg, rgba(232,121,249,0.6) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(120deg, rgba(103,232,249,0.55) 0 1px, transparent 1px 8px),
    radial-gradient(70% 50% at 0% 100%, rgba(236,72,153,0.5), transparent 70%),
    linear-gradient(160deg, #0a0420, #150a36 50%, #0b0418); }
.bg-swatch-seigaiha { background:
    radial-gradient(circle at 50% 100%, #0b2329 18%, rgba(94,234,212,0.3) 19% 24%, #0b2329 25% 42%, rgba(94,234,212,0.3) 43% 48%, transparent 49%) 0 0 / 16px 8px,
    radial-gradient(circle at 50% 100%, #0b2329 18%, rgba(94,234,212,0.3) 19% 24%, #0b2329 25% 42%, rgba(94,234,212,0.3) 43% 48%, transparent 49%) 8px 4px / 16px 8px,
    #0b2329; }
.bg-swatch-abyss { background:
    radial-gradient(circle at 20% 82%, transparent 1.6px, rgba(186,230,253,0.65) 2.0px, transparent 2.6px),
    radial-gradient(circle at 64% 70%, transparent 1.1px, rgba(186,230,253,0.65) 1.5px, transparent 2.1px),
    radial-gradient(circle at 36% 54%, transparent 1.3px, rgba(186,230,253,0.65) 1.7px, transparent 2.3px),
    radial-gradient(circle at 78% 40%, transparent 1.7px, rgba(186,230,253,0.65) 2.1px, transparent 2.7px),
    radial-gradient(circle at 24% 28%, transparent 1.0px, rgba(186,230,253,0.65) 1.4px, transparent 2.0px),
    radial-gradient(circle at 56% 16%, transparent 1.2px, rgba(186,230,253,0.65) 1.6px, transparent 2.2px),
    radial-gradient(circle at 86% 88%, transparent 1.1px, rgba(186,230,253,0.65) 1.5px, transparent 2.1px),
    linear-gradient(100deg, transparent 30%, rgba(125,211,252,0.22) 40%, transparent 50%) 0 0 / 100% 60% no-repeat,
    linear-gradient(180deg, #0b2d4f, #04172d 55%, #020b1a); }
.bg-swatch-yozakura { background:
    radial-gradient(circle at 80% 12%, #fff1f2 0 3px, rgba(254,205,211,0.6) 5px, transparent 11px),
    radial-gradient(3.2px 1.8px at 14% 30%, rgba(251,182,206,0.85) 70%, transparent 76%),
    radial-gradient(3.2px 1.8px at 46% 18%, rgba(244,114,182,0.7) 70%, transparent 76%),
    radial-gradient(3.2px 1.8px at 30% 52%, rgba(251,182,206,0.85) 70%, transparent 76%),
    radial-gradient(3.2px 1.8px at 70% 40%, rgba(244,114,182,0.7) 70%, transparent 76%),
    radial-gradient(3.2px 1.8px at 16% 76%, rgba(244,114,182,0.7) 70%, transparent 76%),
    radial-gradient(3.2px 1.8px at 58% 66%, rgba(251,182,206,0.85) 70%, transparent 76%),
    radial-gradient(3.2px 1.8px at 84% 82%, rgba(251,182,206,0.85) 70%, transparent 76%),
    radial-gradient(3.2px 1.8px at 40% 90%, rgba(244,114,182,0.7) 70%, transparent 76%),
    radial-gradient(45% 30% at 0% 0%, rgba(244,114,182,0.5), transparent 70%),
    linear-gradient(170deg, #1d0c27, #0d0614); }
.bg-swatch-firefly { background:
    radial-gradient(circle at 18% 22%, #ecfccb 0 0.9px, rgba(190,242,100,0.55) 1.7px, transparent 3.6px),
    radial-gradient(circle at 62% 14%, #fef9c3 0 0.9px, rgba(250,204,21,0.5) 1.7px, transparent 3.6px),
    radial-gradient(circle at 40% 38%, #ecfccb 0 0.9px, rgba(190,242,100,0.55) 1.7px, transparent 3.6px),
    radial-gradient(circle at 80% 44%, #ecfccb 0 0.9px, rgba(190,242,100,0.55) 1.7px, transparent 3.6px),
    radial-gradient(circle at 14% 56%, #fef9c3 0 0.9px, rgba(250,204,21,0.5) 1.7px, transparent 3.6px),
    radial-gradient(circle at 54% 62%, #ecfccb 0 0.9px, rgba(190,242,100,0.55) 1.7px, transparent 3.6px),
    radial-gradient(circle at 30% 74%, #ecfccb 0 0.9px, rgba(190,242,100,0.55) 1.7px, transparent 3.6px),
    radial-gradient(circle at 74% 70%, #fef9c3 0 0.9px, rgba(250,204,21,0.5) 1.7px, transparent 3.6px),
    radial-gradient(circle at 88% 24%, #ecfccb 0 0.9px, rgba(190,242,100,0.55) 1.7px, transparent 3.6px),
    radial-gradient(80% 22% at 50% 106%, #020a06 98%, transparent),
    linear-gradient(180deg, #060f1c, #06170f 50%, #04110b); }
.bg-swatch-bokeh { background:
    radial-gradient(circle at 28% 26%, rgba(251,191,36,0.3) 0 8px, rgba(251,191,36,0.5) 9px, transparent 10px),
    radial-gradient(circle at 72% 52%, rgba(251,146,60,0.28) 0 11px, rgba(251,146,60,0.45) 12px, transparent 13px),
    radial-gradient(circle at 34% 80%, rgba(244,114,182,0.25) 0 7px, rgba(244,114,182,0.4) 8px, transparent 9px),
    linear-gradient(180deg, #120c12, #1a100c 55%, #110a08); }
.bg-swatch-ink { background:
    radial-gradient(circle at 80% 14%, rgba(185,28,28,0.75) 0 5px, transparent 8px),
    url('/backgrounds/ink-near.svg?v=1') 0 100% / 260% 46% no-repeat,
    url('/backgrounds/ink-near.svg?v=1') 30% 100% / 200% 30% no-repeat,
    linear-gradient(180deg, #17191d, #0b0c0f); }
/* v148：楓紅、雪夜、煙火、雨夜、竹林的小方塊 */
.bg-swatch-maple { background:
    url('/backgrounds/maple-near.svg?v=1') 0 0 / 52px 60px,
    radial-gradient(circle at 84% 10%, rgba(254,215,170,0.5) 0 4px, transparent 14px),
    linear-gradient(170deg, #1f0d0a, #0e0604); }
.bg-swatch-snow { background:
    radial-gradient(circle at 18% 10%, #f1f5f9 0 4px, rgba(186,230,253,0.3) 7px, transparent 14px),
    radial-gradient(circle at 5px 6px, rgba(255,255,255,0.9) 0 1px, transparent 1.6px) 0 0 / 13px 15px,
    radial-gradient(circle at 9px 3px, rgba(255,255,255,0.7) 0 1.4px, transparent 2px) 0 0 / 19px 21px,
    linear-gradient(180deg, #070c1d, #0d1a36); }
.bg-swatch-fireworks { background:
    url('/backgrounds/fireworks-a.svg?v=1') -10px -6px / 104px 92px,
    url('/backgrounds/fireworks-b.svg?v=1') 20px 40px / 120px 108px,
    linear-gradient(180deg, #06051a, #120d2c); }
.bg-swatch-rain { background:
    url('/backgrounds/rain.svg?v=1') 0 0 / 36px 48px,
    radial-gradient(circle at 25% 80%, rgba(251,191,36,0.35), transparent 30%),
    radial-gradient(circle at 72% 88%, rgba(45,212,191,0.3), transparent 32%),
    linear-gradient(180deg, #0b111b, #111a27); }
.bg-swatch-bamboo { background:
    url('/backgrounds/bamboo-near.svg?v=1') 0 100% / auto 100% repeat-x,
    radial-gradient(circle at 80% 8%, rgba(220,252,231,0.45) 0 3px, transparent 14px),
    linear-gradient(180deg, #061a12, #030c08); }
/* ==== v110：5 款漸層色。和原始漸層同樣的做法（漸層底色＋三顆漂浮光暈），只換顏色；聊天中光暈一樣會變淡。 ==== */
html[data-tt-background="teal"] body { background: #031417; }
html[data-tt-background="teal"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #0f3a40 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #082f49 0%, transparent 50%),
        linear-gradient(135deg, #031417 0%, #0a2229 100%);
}
html[data-tt-background="teal"] .orb-1 { background: radial-gradient(circle, #14b8a6, transparent 70%); }
html[data-tt-background="teal"] .orb-2 { background: radial-gradient(circle, #3b82f6, transparent 70%); }
html[data-tt-background="teal"] .orb-3 { background: radial-gradient(circle, #22d3ee, transparent 70%); }

html[data-tt-background="wine"] body { background: #14060c; }
html[data-tt-background="wine"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #4c0519 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #3b0764 0%, transparent 50%),
        linear-gradient(135deg, #14060c 0%, #22091a 100%);
}
html[data-tt-background="wine"] .orb-1 { background: radial-gradient(circle, #e11d48, transparent 70%); }
html[data-tt-background="wine"] .orb-2 { background: radial-gradient(circle, #c026d3, transparent 70%); }
html[data-tt-background="wine"] .orb-3 { background: radial-gradient(circle, #f97316, transparent 70%); }

html[data-tt-background="emerald"] body { background: #03130d; }
html[data-tt-background="emerald"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #064e3b 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #134e4a 0%, transparent 50%),
        linear-gradient(135deg, #03130d 0%, #0a1f18 100%);
}
html[data-tt-background="emerald"] .orb-1 { background: radial-gradient(circle, #10b981, transparent 70%); }
html[data-tt-background="emerald"] .orb-2 { background: radial-gradient(circle, #06b6d4, transparent 70%); }
html[data-tt-background="emerald"] .orb-3 { background: radial-gradient(circle, #84cc16, transparent 70%); }

html[data-tt-background="amber"] body { background: #140c05; }
html[data-tt-background="amber"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #451a03 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #4c0519 0%, transparent 50%),
        linear-gradient(135deg, #140c05 0%, #1f1309 100%);
}
html[data-tt-background="amber"] .orb-1 { background: radial-gradient(circle, #f59e0b, transparent 70%); }
html[data-tt-background="amber"] .orb-2 { background: radial-gradient(circle, #ef4444, transparent 70%); }
html[data-tt-background="amber"] .orb-3 { background: radial-gradient(circle, #f472b6, transparent 70%); }

html[data-tt-background="graphite"] body { background: #0b0d12; }
html[data-tt-background="graphite"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #1e293b 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #27272a 0%, transparent 50%),
        linear-gradient(135deg, #0b0d12 0%, #171a21 100%);
}
html[data-tt-background="graphite"] .orb-1 { background: radial-gradient(circle, #64748b, transparent 70%); }
html[data-tt-background="graphite"] .orb-2 { background: radial-gradient(circle, #38bdf8, transparent 70%); }
html[data-tt-background="graphite"] .orb-3 { background: radial-gradient(circle, #a1a1aa, transparent 70%); }

/* v148：再加 5 款漸層色：藍寶石、紫羅蘭、櫻粉、冰川、午夜金（做法相同，只換顏色） */
html[data-tt-background="sapphire"] body { background: #040a1f; }
html[data-tt-background="sapphire"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #172554 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #1e3a8a 0%, transparent 50%),
        linear-gradient(135deg, #040a1f 0%, #0b1636 100%);
}
html[data-tt-background="sapphire"] .orb-1 { background: radial-gradient(circle, #2563eb, transparent 70%); }
html[data-tt-background="sapphire"] .orb-2 { background: radial-gradient(circle, #1d4ed8, transparent 70%); }
html[data-tt-background="sapphire"] .orb-3 { background: radial-gradient(circle, #60a5fa, transparent 70%); }

html[data-tt-background="violet"] body { background: #0e0720; }
html[data-tt-background="violet"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #3b0764 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #4c1d95 0%, transparent 50%),
        linear-gradient(135deg, #0e0720 0%, #1a0d33 100%);
}
html[data-tt-background="violet"] .orb-1 { background: radial-gradient(circle, #9333ea, transparent 70%); }
html[data-tt-background="violet"] .orb-2 { background: radial-gradient(circle, #7c3aed, transparent 70%); }
html[data-tt-background="violet"] .orb-3 { background: radial-gradient(circle, #c084fc, transparent 70%); }

html[data-tt-background="blossom"] body { background: #16070f; }
html[data-tt-background="blossom"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #500724 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #4a1d3f 0%, transparent 50%),
        linear-gradient(135deg, #16070f 0%, #22101b 100%);
}
html[data-tt-background="blossom"] .orb-1 { background: radial-gradient(circle, #f472b6, transparent 70%); }
html[data-tt-background="blossom"] .orb-2 { background: radial-gradient(circle, #fb7185, transparent 70%); }
html[data-tt-background="blossom"] .orb-3 { background: radial-gradient(circle, #f9a8d4, transparent 70%); }

html[data-tt-background="glacier"] body { background: #06111b; }
html[data-tt-background="glacier"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #0c4a6e 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #1e3a5f 0%, transparent 50%),
        linear-gradient(135deg, #06111b 0%, #0c1c2a 100%);
}
html[data-tt-background="glacier"] .orb-1 { background: radial-gradient(circle, #67e8f9, transparent 70%); }
html[data-tt-background="glacier"] .orb-2 { background: radial-gradient(circle, #93c5fd, transparent 70%); }
html[data-tt-background="glacier"] .orb-3 { background: radial-gradient(circle, #e0f2fe, transparent 70%); }

html[data-tt-background="midnight-gold"] body { background: #070a18; }
html[data-tt-background="midnight-gold"] .app-bg {
    background:
        radial-gradient(ellipse at top left, #1e1b4b 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, #422006 0%, transparent 50%),
        linear-gradient(135deg, #070a18 0%, #0f1428 100%);
}
html[data-tt-background="midnight-gold"] .orb-1 { background: radial-gradient(circle, #f59e0b, transparent 70%); }
html[data-tt-background="midnight-gold"] .orb-2 { background: radial-gradient(circle, #3b5bdb, transparent 70%); }
html[data-tt-background="midnight-gold"] .orb-3 { background: radial-gradient(circle, #fcd34d, transparent 70%); }

/* v110：漸層色的小方塊（縮小版：底色漸層加上三顆光暈的位置） */
.bg-swatch-teal { background:
    radial-gradient(circle at 18% 16%, rgba(20,184,166,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(59,130,246,0.75), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(34,211,238,0.45), transparent 34%),
    linear-gradient(135deg, #031417, #0a2229); }
.bg-swatch-wine { background:
    radial-gradient(circle at 18% 16%, rgba(225,29,72,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(192,38,211,0.75), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(249,115,22,0.45), transparent 34%),
    linear-gradient(135deg, #14060c, #22091a); }
.bg-swatch-emerald { background:
    radial-gradient(circle at 18% 16%, rgba(16,185,129,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(6,182,212,0.7), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(132,204,22,0.45), transparent 34%),
    linear-gradient(135deg, #03130d, #0a1f18); }
.bg-swatch-amber { background:
    radial-gradient(circle at 18% 16%, rgba(245,158,11,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(239,68,68,0.7), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(244,114,182,0.45), transparent 34%),
    linear-gradient(135deg, #140c05, #1f1309); }
.bg-swatch-graphite { background:
    radial-gradient(circle at 18% 16%, rgba(100,116,139,0.85), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(56,189,248,0.6), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(161,161,170,0.45), transparent 34%),
    linear-gradient(135deg, #0b0d12, #171a21); }
.bg-swatch-sapphire { background:
    radial-gradient(circle at 18% 16%, rgba(37,99,235,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(29,78,216,0.75), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(96,165,250,0.45), transparent 34%),
    linear-gradient(135deg, #040a1f, #0b1636); }
.bg-swatch-violet { background:
    radial-gradient(circle at 18% 16%, rgba(147,51,234,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(124,58,237,0.75), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(192,132,252,0.45), transparent 34%),
    linear-gradient(135deg, #0e0720, #1a0d33); }
.bg-swatch-blossom { background:
    radial-gradient(circle at 18% 16%, rgba(244,114,182,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(251,113,133,0.75), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(249,168,212,0.45), transparent 34%),
    linear-gradient(135deg, #16070f, #22101b); }
.bg-swatch-glacier { background:
    radial-gradient(circle at 18% 16%, rgba(103,232,249,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(147,197,253,0.75), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(224,242,254,0.45), transparent 34%),
    linear-gradient(135deg, #06111b, #0c1c2a); }
.bg-swatch-midnight-gold { background:
    radial-gradient(circle at 18% 16%, rgba(245,158,11,0.8), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(59,91,219,0.75), transparent 52%),
    radial-gradient(circle at 56% 52%, rgba(252,211,77,0.45), transparent 34%),
    linear-gradient(135deg, #070a18, #0f1428); }

/* v110：設定視窗的段落標題 */
.settings-heading { width: 100%; font-size: 0.95rem; font-weight: 800; color: #e2e8f0; margin-top: 0.35rem; }
.bg-group-title { width: 100%; font-size: 0.8rem; font-weight: 700; color: #cbd5e1; margin-top: 2px; }
.font-size-toggle { width: 100%; }
.font-size-toggle .q-btn { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
/* v159：五顆按鈕（多了「自訂」）在手機上字調到 140% 時，「標準」「特大」也不會被擠成直排 */
.font-custom-input { width: 100%; max-width: 240px; }   /* v159：自訂字體大小（%） */
/* v160：字型小卡片（6 款排成 3×2），卡片上的字用那一款字型顯示 */
.font-family-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.font-family-tile {
    appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; min-width: 0; touch-action: manipulation;
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 14px;
    background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.12); color: #e2e8f0; line-height: 1.2;
}
.font-family-tile[aria-pressed="true"] { background: rgba(99,102,241,0.28); border-color: #818cf8; }
.font-family-tile:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.font-family-sample { font-size: 1.55rem; color: #fff; line-height: 1.15; }
.font-family-name { font-size: 0.85rem; margin-top: 3px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-family-style { font-size: 0.7rem; color: #94a3b8; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-family-tile[aria-pressed="true"] .font-family-name { color: #fff; font-weight: 700; }
.sound-style-toggle { width: 100%; }
.fx-style-toggle { width: 100%; flex-wrap: wrap; }   /* v119：四種灑花樣式，手機上排成兩行 */
/* v122：封鎖名單與封鎖後的「復原」 */
.block-list { max-height: 52vh; overflow-y: auto; }
.block-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.block-item-avatar { flex: 0 0 40px; width: 40px; height: 40px; }
.block-item-avatar img, .block-item-avatar-empty { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.08); display: block; }
.block-item-avatar-empty { line-height: 40px; text-align: center; color: #94a3b8; font-weight: 700; }
.block-item-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.block-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-item-meta { font-size: 0.75rem; color: #94a3b8; line-height: 1.4; }
.block-item-btn { flex: 0 0 auto; color: #c4b5fd !important; }
.block-list-help { font-size: 0.8rem; color: #94a3b8; margin-top: 8px; }
.block-list-help summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; color: #c4b5fd; }
.block-list-help summary::-webkit-details-marker { display: none; }
.block-list-help summary::after { content: ''; width: 0.45rem; height: 0.45rem; margin-top: -0.2rem; border-right: 2px solid #a78bfa;
    border-bottom: 2px solid #a78bfa; transform: rotate(45deg); transition: transform 0.2s ease, margin 0.2s ease; }
.block-list-help[open] summary::after { transform: rotate(-135deg); margin-top: 0.2rem; }
.block-list-help summary:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; border-radius: 4px; }
.block-list-help ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.block-undo-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 3000; display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px);
    padding: 8px 8px 8px 16px; border-radius: 16px; background: rgba(15,23,42,0.97); border: 1px solid rgba(167,139,250,0.5);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5); color: #e2e8f0; font-size: 0.9rem; }
.block-undo-text { line-height: 1.45; }
.block-undo-btn { flex: 0 0 auto; color: #c4b5fd !important; font-weight: 700; }
.fx-style-toggle .q-btn { flex: 1 1 calc(50% - 2px); white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.sound-style-toggle .q-btn { flex: 1 1 auto; white-space: nowrap; padding-left: 8px; padding-right: 8px; }   /* 「叮咚（預設）」不換行 */
.sound-timing-toggle .q-btn { flex: 1 1 0; min-width: 0; white-space: normal; }

/* v110：字體大小。--tt-font-scale 由 _threeTalkAppearance.applyFont() 設定；1＝原本的大小（沒設定時也是 1）。
   自己寫的字級大多用 rem，所以調整根元素就會一起變大變小；Quasar 元件用 px 的字級放在 quasar 圖層裡一起調整，
   這樣 Tailwind 的 text-xs、text-sm 等寫在元素上的字級仍然照原本的比例。 */
html { font-size: calc(100% * var(--tt-font-scale, 1)); }
@layer quasar {
    body, .q-btn, .q-chip, .q-field, .q-tab__label, .q-field--dense .q-field__label { font-size: calc(14px * var(--tt-font-scale, 1)); }
    .q-field__label { font-size: calc(16px * var(--tt-font-scale, 1)); }
    .q-badge, .q-field__bottom, .q-slider__text, .q-notification__badge { font-size: calc(12px * var(--tt-font-scale, 1)); }
    .q-tooltip--style { font-size: calc(10px * var(--tt-font-scale, 1)); }
}
.mode-heading { font-size: 0.85rem; color: #94a3b8; letter-spacing: 0.1em; margin-bottom: 0.6rem; }
    .appearance-card { width: min(440px, 92vw); max-height: 85dvh; overflow-y: auto;
        background: #131838; color: #f1f5f9; padding: 20px; border-radius: 20px; gap: 12px;
        border: 1px solid #535a80; }
    @media (min-width: 1024px) {
        body.in-chat .compact-bar {
            width: calc(100% - 48px); max-width: var(--tt-reading-width, 1080px); margin-inline: auto;
            top: calc(var(--chat-top, 0px) + 16px); border-radius: 16px;
            border: 1px solid rgba(255,255,255,0.08);
        }
        body.in-chat .chat-main-area {
            width: calc(100% - 48px) !important; max-width: var(--tt-reading-width, 1080px) !important;
            top: calc(var(--chat-top, 0px) + 16px);
            height: calc(var(--chat-height, 100vh) - 32px); height: calc(var(--chat-height, 100dvh) - 32px);
            padding-bottom: 8px !important;
        }
        body.in-chat .msg-content { max-width: min(78%, 680px); }
        body.in-chat .msg-row.msg-me .msg-content, body.in-chat .msg-row.msg-partner .msg-content { max-width: min(78%, 680px, calc(100% - 112px)); }
        .msg-sticker-img { width: 136px; height: 136px; }
        .msg-photo-img { max-width: 136px; max-height: 136px; }
        .sticker-panel { max-height: min(40vh, 320px); }
        .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
    }
    @media (max-width: 480px) {
        .compact-bar .logo-text { display: none; }
    }
    /* v67：單一瀏覽器渲染根節點，避免每則訊息都建立 NiceGUI/Vue 元件。 */
    .browser-chat-messages { width: 100%; min-height: 100%; }
    .browser-chat-messages > .msg-shell,
    .browser-chat-messages > .browser-chat-event { width: 100%; }

    /* v135：站方跑馬燈（方案 A）。畫面最上方一條，設定頁、大廳、聊天室都在同一個位置；
       顯示時 body 加上 has-marquee，下面的內容整個往下移，不會被蓋住。 */
    :root { --tt-marquee-h: 0px; }
    body.has-marquee { --tt-marquee-h: calc(38px + env(safe-area-inset-top, 0px)); }
    body.has-marquee.chat-tiny-viewport { --tt-marquee-h: 0px; }
    .tt-marquee {
        position: fixed; top: 0; left: 0; right: 0; z-index: 2600;
        display: flex; align-items: center; gap: 10px; box-sizing: border-box;
        height: var(--tt-marquee-h);
        padding: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px));
        background: linear-gradient(90deg, #3a2a07, #2b2560);
        border-bottom: 1px solid rgba(251, 191, 36, 0.42);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
        color: #fef3c7; font-size: 14px; font-weight: 600; line-height: 1.2;
    }
    .tt-marquee[hidden], body.chat-tiny-viewport .tt-marquee { display: none !important; }
    body.in-chat .tt-marquee { top: var(--chat-top, 0px); }
    .tt-marquee-tag {
        flex: none; padding: 3px 10px; border-radius: 999px; background: #fbbf24; color: #3b2a05;
        font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap;
    }
    .tt-marquee-track {
        flex: 1; min-width: 0; overflow: hidden; white-space: nowrap;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
                mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
    }
    .tt-marquee-inner { display: inline-block; padding-left: 6px; color: inherit; text-decoration: none; white-space: nowrap; }
    .tt-marquee-inner[href] .tt-marquee-text { text-decoration: underline; text-decoration-color: rgba(254, 243, 199, 0.45); text-underline-offset: 3px; }
    .tt-marquee-inner[href] { cursor: pointer; }
    .tt-marquee-copy { display: none; }
    .tt-marquee.scrolling .tt-marquee-copy { display: inline; }
    .tt-marquee.scrolling .tt-marquee-text { padding-right: 56px; }
    .tt-marquee.scrolling .tt-marquee-inner { animation: tt-marquee-run var(--tt-marquee-duration, 20s) linear 1.5s infinite; }
    .tt-marquee:hover .tt-marquee-inner, .tt-marquee:focus-within .tt-marquee-inner { animation-play-state: paused; }
    @keyframes tt-marquee-run {
        from { transform: translateX(0); }
        to { transform: translateX(var(--tt-marquee-to, -100%)); }
    }
    .tt-marquee-go {
        flex: none; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(251, 191, 36, 0.6);
        color: #fde68a; font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
    }
    .tt-marquee-go[hidden] { display: none; }
    .tt-marquee-close {
        flex: none; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 0;
        background: rgba(255, 255, 255, 0.1); color: #fde68a; font-size: 15px; line-height: 30px; cursor: pointer;
    }
    .tt-marquee a:focus-visible, .tt-marquee-close:focus-visible { outline: 2px solid #fde68a; outline-offset: 2px; }
    body.has-marquee .q-page-container { padding-top: var(--tt-marquee-h); }
    body.has-marquee.in-chat .q-page-container { padding-top: 0; }
    body.has-marquee.in-chat .compact-bar { top: calc(var(--chat-top, 0px) + var(--tt-marquee-h)); padding-top: 6px; }
    body.has-marquee.in-chat .chat-main-area {
        top: calc(var(--chat-top, 0px) + var(--tt-marquee-h));
        height: calc(var(--chat-height, 100vh) - var(--tt-marquee-h));
        height: calc(var(--chat-height, 100dvh) - var(--tt-marquee-h));
    }
    @media (min-width: 1024px) {
        body.has-marquee.in-chat .compact-bar { top: calc(var(--chat-top, 0px) + var(--tt-marquee-h) + 16px); }
        body.has-marquee.in-chat .chat-main-area {
            top: calc(var(--chat-top, 0px) + var(--tt-marquee-h) + 16px);
            height: calc(var(--chat-height, 100vh) - 32px - var(--tt-marquee-h));
            height: calc(var(--chat-height, 100dvh) - 32px - var(--tt-marquee-h));
        }
    }
    @media (max-width: 380px) {
        .tt-marquee { gap: 7px; }
        .tt-marquee-tag { padding: 3px 7px; }
        .tt-marquee-go { padding: 4px 8px; }
    }
    @media (prefers-reduced-motion: reduce) {
        .tt-marquee.scrolling .tt-marquee-inner { animation: none; }
        .tt-marquee.scrolling .tt-marquee-copy { display: none; }
        .tt-marquee.scrolling .tt-marquee-text { padding-right: 0; }
        .tt-marquee-inner { display: block; overflow: hidden; text-overflow: ellipsis; }
    }