/* 慢慢：雾蓝灰的对话房间。低饱和、轻、薄、留白多；气泡两边都有头像，一个个弹出来。 */
.tb-overlay {
    --tb-bg: #f4f7f8; --tb-bg2: #edf2f4; --tb-card: #ffffff; --tb-ink: #38434a; --tb-sub: #8a979f;
    --tb-line: #e2e9ed; --tb-accent: #7f9aab; --tb-accent-2: #e8eff3; --tb-user: #dbe6ec; --tb-ok: #82b19c;
    --tb-note: #f8f5ea; --tb-note-line: #ebe4c9; --tb-note-ink: #a99a63; --tb-shadow: rgba(60, 85, 100, .08);
    --tb-cloud: rgba(255, 255, 255, .78); --tb-spark: #ffffff; --tb-blob1: rgba(150, 190, 208, .32); --tb-blob2: rgba(170, 207, 190, .28);
    --tb-hill2: #e5edf1; --tb-hill1: #dde8ed; --tb-ground: #d4e1e7;
    --tb-sn-body: #bccfd8; --tb-sn-shell: #a3bac7; --tb-sn-line: #e9f1f4; --tb-sn-eye: #55666f;
    --tb-dot-off: #d3dde3; --tb-dot-on: #5f8296;
    position: fixed; inset: 0; z-index: 12041; visibility: hidden; opacity: 0; transition: opacity .25s, visibility .25s;
    color: var(--tb-ink); font-family: inherit; background: var(--tb-bg);
}
[data-ui="dark"] .tb-overlay, .dark-mode .tb-overlay {
    --tb-bg: #1a2024; --tb-bg2: #161b1f; --tb-card: #242c31; --tb-ink: #e3eaee; --tb-sub: #8e9ba3;
    --tb-line: #313a40; --tb-accent: #8fb0c4; --tb-accent-2: #29353d; --tb-user: #30434f; --tb-ok: #8cc2aa;
    --tb-note: #2d2c24; --tb-note-line: #4a4630; --tb-note-ink: #b5a76e; --tb-shadow: rgba(0, 0, 0, .3);
    --tb-cloud: rgba(255, 255, 255, .06); --tb-spark: #8fb0c4; --tb-blob1: rgba(100, 150, 175, .2); --tb-blob2: rgba(110, 160, 140, .16);
    --tb-hill2: #1f272c; --tb-hill1: #222b31; --tb-ground: #283239;
    --tb-sn-body: #52646f; --tb-sn-shell: #647b89; --tb-sn-line: #86a0ae; --tb-sn-eye: #dbe6ec;
    --tb-dot-off: #3a474f; --tb-dot-on: #a6c9dc;
}
.tb-overlay.is-open { visibility: visible; opacity: 1; }
.tb-panel { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: linear-gradient(180deg, var(--tb-bg) 0%, var(--tb-bg2) 100%); }
.tb-overlay button, .tb-overlay textarea, .tb-overlay input { font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

/* 背景小场景：灰蓝山丘、草地、慢慢爬的蜗牛、飘过的云、闪烁的小星点（全在最底层，不挡操作） */
.tb-head, .tb-progress, .tb-scroll, .tb-actions { position: relative; z-index: 1; }
.tb-bg { --tb-gh: calc(max(var(--tb-act-h, 0px), env(safe-area-inset-bottom, 0px)) + 40px); position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.tb-bg span { position: absolute; display: block; }
.tb-blob { width: 78vw; height: 78vw; max-width: 460px; max-height: 460px; border-radius: 50%; }
.tb-blob.b1 { left: -22%; top: 4%; background: radial-gradient(circle, var(--tb-blob1), transparent 68%); animation: tb-blob1 26s ease-in-out infinite alternate; }
.tb-blob.b2 { right: -26%; top: 36%; background: radial-gradient(circle, var(--tb-blob2), transparent 68%); animation: tb-blob2 32s ease-in-out infinite alternate; }
@keyframes tb-blob1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(14vw, 8vh) scale(1.12); } }
@keyframes tb-blob2 { from { transform: translate(0, 0) scale(1.05); } to { transform: translate(-12vw, -7vh) scale(.92); } }
.tb-cloud { left: 0; width: 92px; height: 26px; border-radius: 20px; background: var(--tb-cloud); animation: tb-drift 90s linear infinite; }
.tb-cloud::before, .tb-cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.tb-cloud::before { width: 40px; height: 40px; left: 14px; top: -18px; }
.tb-cloud::after { width: 30px; height: 30px; left: 48px; top: -11px; }
.tb-cloud.c1 { top: 11%; animation-duration: 95s; animation-delay: -30s; }
.tb-cloud.c2 { top: 27%; transform-origin: left; width: 66px; height: 20px; animation-duration: 130s; animation-delay: -88s; opacity: .8; }
.tb-cloud.c3 { top: 47%; width: 78px; animation-duration: 160s; animation-delay: -12s; opacity: .6; }
@keyframes tb-drift { from { transform: translateX(-140px); } to { transform: translateX(calc(100vw + 40px)); } }
.tb-spark { width: var(--z, 10px); height: var(--z, 10px); background: var(--tb-spark); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0; animation: tb-twinkle 4.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes tb-twinkle { 0%, 100% { opacity: 0; transform: scale(.5) rotate(0); } 50% { opacity: .95; transform: scale(1) rotate(45deg); } }
.tb-hill { left: -10%; width: 70%; height: 110px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; transition: bottom .3s; }
.tb-hill.h2 { left: 38%; width: 80%; height: 96px; bottom: calc(var(--tb-gh) - 34px); background: var(--tb-hill2); }
.tb-hill.h1 { bottom: calc(var(--tb-gh) - 40px); background: var(--tb-hill1); }
.tb-ground { left: 0; right: 0; bottom: 0; height: var(--tb-gh); background: var(--tb-ground); transition: height .3s; }
.tb-ground::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 8px; background: radial-gradient(circle at 7px 8px, var(--tb-ground) 5.5px, transparent 6px) repeat-x; background-size: 14px 8px; }
/* 蜗牛：慢慢爬过草地，触角会晃，身体一伸一缩 */
.tb-snail { position: absolute; left: 0; bottom: calc(var(--tb-gh) - 3px); transition: bottom .3s; animation: tb-crawl 100s linear infinite; animation-delay: -34s; }
@keyframes tb-crawl { 0% { transform: translateX(-70px); opacity: 0; } 3% { opacity: 1; } 97% { opacity: 1; } 100% { transform: translateX(calc(100vw + 30px)); opacity: 0; } }
.sn-body { fill: var(--tb-sn-body); transform-box: fill-box; transform-origin: 0 50%; animation: tb-squish 2.4s ease-in-out infinite; }
.sn-st path { stroke: var(--tb-sn-body); stroke-width: 1.8; stroke-linecap: round; fill: none; }
.sn-st circle { fill: var(--tb-sn-eye); }
.sn-st { transform-box: fill-box; transform-origin: 50% 100%; animation: tb-wiggle 2.8s ease-in-out infinite; }
.sn-st2 { animation-delay: -1.1s; }
.sn-shell circle { fill: var(--tb-sn-shell); }
.sn-shell path { fill: none; stroke: var(--tb-sn-line); stroke-width: 1.5; stroke-linecap: round; }
@keyframes tb-squish { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.07); } }
@keyframes tb-wiggle { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }

/* 顶栏 */
.tb-head { display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 4px; }
.tb-icon-btn { width: 38px; height: 38px; border: 0; background: transparent; padding: 0; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; color: var(--tb-ink); transition: opacity .15s; }
.tb-icon-btn:active { opacity: .45; }
.tb-titlebox { flex: 1; min-width: 0; text-align: center; }
.tb-titlebox h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-titlebox p { margin: 1px 0 0; font-size: 11.5px; color: var(--tb-sub); }

/* 进度圆点：每个圆点是一页，点一下翻过去 */
.tb-progress { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 26px; padding: 0 16px 4px; }
.tb-overlay[data-screen="home"] .tb-progress { display: none; }
.tb-dots { display: flex; flex-wrap: wrap; justify-content: center; max-width: 78%; }
.tb-dot-b { width: 22px; height: 26px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tb-dot-b.is-next { cursor: default; pointer-events: none; }
.tb-dot-b i { box-sizing: border-box; width: 7px; height: 7px; border-radius: 50%; background: var(--tb-line); transition: background .3s, transform .3s, box-shadow .2s; }
.tb-dot-b.is-next i { opacity: .55; }
.tb-dot-b i.on { background: var(--tb-ok); }
.tb-dot-b i.skip { background: var(--tb-sub); opacity: .5; }
.tb-dot-b i.swap { background: transparent; border: 1.5px solid var(--tb-sub); opacity: .7; }
.tb-dot-b i.cur { background: var(--tb-accent); transform: scale(1.3); }
.tb-dot-b.is-view i { box-shadow: 0 0 0 2px var(--tb-bg), 0 0 0 3.5px var(--tb-accent); }
.tb-dot-b:active i { transform: scale(.85); }
.tb-prog-txt { font-size: 11.5px; font-weight: 500; color: var(--tb-sub); }

.tb-scroll { position: relative; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 14px 16px; }
.tb-scroll { display: flex; flex-direction: column; }
.tb-home { width: 100%; max-width: 560px; margin: 0 auto; }
.tb-room { width: 100%; max-width: 560px; margin: auto; }   /* 内容少的时候上下居中；内容多了自动变回从上往下排、可滚动 */

/* 头像 */
.tb-av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--tb-accent-2); }
.tb-av-ph { display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--tb-accent); }
.tb-av-gap { visibility: hidden; }

/* 气泡：薄边 + 柔和阴影，只有一点点歪 */
.tb-row { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; }
.tb-row[hidden] { display: none; }
.tb-row.is-grouped { margin-top: 3px; }
.tb-row.is-user { justify-content: flex-end; }
.tb-bubble {
    --r: 0deg;
    max-width: 66%; width: fit-content; padding: 7px 14px; font-size: 14px; line-height: 1.5; font-weight: 400; word-break: break-word;
    background: var(--tb-card); border: 1px solid var(--tb-line); box-shadow: 0 1px 2px var(--tb-shadow);
    border-radius: 18px;
}
.tb-row.is-user .tb-bubble { background: var(--tb-user); border-color: transparent; box-shadow: none; }
.tb-row.is-fresh .tb-bubble { animation: tb-pop-flat .32s cubic-bezier(.2, .9, .3, 1.2) both; }
.tb-row.is-fresh .tb-bubble.is-step { animation: tb-pop .42s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes tb-pop-flat { 0% { opacity: 0; transform: scale(.82) translateY(6px); } 100% { opacity: 1; transform: none; } }
@keyframes tb-pop {
    0% { opacity: 0; transform: rotate(calc(var(--r) - 3deg)) scale(.7) translateY(8px); }
    65% { opacity: 1; transform: rotate(calc(var(--r) + .5deg)) scale(1.03); }
    100% { opacity: 1; transform: rotate(var(--r)) scale(1); }
}

/* 「…」输入中：三个点把气泡撑开，永远贴在头像旁边 */
.tb-bubble.is-typing { display: inline-flex; align-items: center; gap: 5px; padding: 0 15px; height: 33px; box-sizing: border-box; flex: none; align-self: flex-start; }
/* 锁死位置：不管外面有什么别的样式，「输入中」永远老老实实待在头像右边 */
#tb-typing { position: relative !important; inset: auto !important; transform: none !important; float: none !important; }
#tb-typing .tb-bubble { position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; float: none !important; animation: none !important; }
.tb-bubble.is-typing i { flex: none; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--tb-dot-off); animation: tb-bounce 1.2s infinite; }
.tb-bubble.is-typing i:nth-child(2) { animation-delay: .22s; } .tb-bubble.is-typing i:nth-child(3) { animation-delay: .44s; }
/* 每个点只亮一小段（约 0.3 秒），三个点错开 0.22 秒，一个接一个；只改颜色和光晕，不位移 */
@keyframes tb-bounce { 0%, 34%, 100% { background-color: var(--tb-dot-off); box-shadow: 0 0 0 0 transparent; } 12% { background-color: var(--tb-dot-on); box-shadow: 0 0 0 3px var(--tb-accent-2); } }

/* 「现在做这个」的步骤卡片：米色便条，保留一点歪斜 */
.tb-bubble.is-step { background: var(--tb-note); border: 1px solid var(--tb-note-line); max-width: 80%; padding: 10px 14px; border-radius: 14px; transform: rotate(var(--r)); transform-origin: left top; }
.tb-bubble.is-step small { display: block; font-size: 11px; font-weight: 500; color: var(--tb-note-ink); letter-spacing: .03em; margin-bottom: 3px; }
.tb-bubble.is-step b { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.tb-check { flex: none; width: 17px; height: 17px; margin-top: 3px; border-radius: 6px; border: 1.5px solid var(--tb-note-ink); background: transparent; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; color: #fff; transition: background .25s, border-color .25s; }
.tb-bubble.is-step.is-done, .tb-bubble.is-step.is-skipped, .tb-bubble.is-step.is-swap { opacity: .72; }
.tb-bubble.is-step.is-done .tb-check { background: var(--tb-ok); border-color: var(--tb-ok); animation: tb-tick .35s cubic-bezier(.2, .9, .3, 1.5); }
.tb-bubble.is-step.is-skipped .tb-check, .tb-bubble.is-step.is-swap .tb-check { background: var(--tb-sub); border-color: var(--tb-sub); }
.tb-bubble.is-step.is-swap .tb-check { font-size: 9.5px; }
.tb-bubble.is-step.is-done b span { text-decoration: line-through; text-decoration-color: var(--tb-sub); }
@keyframes tb-tick { 0% { transform: scale(.5); } 100% { transform: scale(1); } }

/* 常驻小动画：当前这步的卡片轻轻摇，进度点呼吸，首页头像浮动，新建按钮缓慢呼吸 */
.tb-bubble.is-step.is-todo { animation: tb-sway 5.5s ease-in-out infinite; }
.tb-row.is-fresh .tb-bubble.is-step.is-todo { animation: tb-pop .42s cubic-bezier(.2, .9, .3, 1.25) both, tb-sway 5.5s .5s ease-in-out infinite; }
@keyframes tb-sway { 0%, 100% { transform: rotate(calc(var(--r) - .5deg)); } 50% { transform: rotate(calc(var(--r) + .5deg)); } }
.tb-dot-b i.cur { animation: tb-ring 2.2s ease-in-out infinite; }
@keyframes tb-ring { 0%, 100% { outline: 0 solid rgba(127, 154, 171, 0); } 50% { outline: 4px solid rgba(127, 154, 171, .24); } }
.tb-hello .tb-av { animation: tb-bob 3.2s ease-in-out infinite; }
@keyframes tb-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.tb-new { animation: tb-breathe 3.8s ease-in-out infinite; }
@keyframes tb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }

/* 翻页 */
.tb-page.is-in-next { animation: tb-page-next .3s cubic-bezier(.2, .8, .3, 1) both; }
.tb-page.is-in-prev { animation: tb-page-prev .3s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes tb-page-next { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes tb-page-prev { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: none; } }

/* 居中的小提示 */
.tb-sys { text-align: center; margin: 14px 0 2px; }
.tb-sys span { display: inline-block; font-size: 12px; font-weight: 500; color: var(--tb-accent); background: var(--tb-accent-2); padding: 4px 12px; border-radius: 999px; }
.tb-sys.is-fresh span { animation: tb-pop-s .4s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes tb-pop-s { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: scale(1); } }

/* 底部操作区 */
.tb-actions { padding: 6px 14px calc(env(safe-area-inset-bottom, 0px) + 10px); background: transparent; }
.tb-overlay[data-screen="home"] .tb-actions { display: none; }
.tb-act-row { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.tb-act-row.is-sub { margin-top: 7px; }
.tb-act-row .tb-btn { flex: 1; }
.tb-actions .tb-input { display: block; max-width: 560px; margin: 0 auto 8px; }

/* 回看旧页时的底栏 */
.tb-hist { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: 2px 0; }
.tb-hist span { flex: 1; font-size: 12.5px; color: var(--tb-sub); }
.tb-hist .tb-btn { flex: none; padding: 10px 16px; }

/* 跟 TA 说一句 */
.tb-say { display: flex; align-items: center; gap: 8px; max-width: 560px; margin: 0 auto 8px; }
.tb-say-in { flex: 1; min-width: 0; box-sizing: border-box; height: 38px; border: 1px solid var(--tb-line); border-radius: 19px; padding: 0 14px; font-size: 14px; background: var(--tb-card); outline: none; transition: border-color .2s; }
.tb-say-in:focus { border-color: var(--tb-accent); }
.tb-say-in::placeholder { color: var(--tb-sub); }
.tb-say-ok { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--tb-accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .12s, opacity .2s; }
.tb-say-ok:active { transform: scale(.92); }
.tb-say-in[disabled], .tb-say-ok[disabled] { opacity: .4; pointer-events: none; }

/* 按钮 */
.tb-btn { border: 0; border-radius: 14px; padding: 11px 14px; font-size: 14px; font-weight: 500; cursor: pointer; transition: transform .12s, opacity .2s; }
.tb-btn:active { transform: scale(.97); }
.tb-btn[disabled] { opacity: .4; pointer-events: none; }
.tb-btn.is-primary { background: var(--tb-accent); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(100, 135, 155, .28); }
.tb-btn.is-soft { background: transparent; border: 1px solid var(--tb-line); color: var(--tb-sub); font-size: 12.5px; padding: 8px 6px; border-radius: 12px; }
.tb-btn.is-ghost { background: transparent; color: var(--tb-sub); }

/* 首页 */
.tb-hello { margin-top: 2px; }
.tb-new { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin: 14px 0 4px; padding: 12px; border: 1.5px dashed var(--tb-accent); border-radius: 16px; background: transparent; color: var(--tb-accent); font-size: 14.5px; font-weight: 600; cursor: pointer; transition: transform .12s, background .2s; box-sizing: border-box; }
.tb-new span { font-size: 18px; line-height: 1; font-weight: 400; }
.tb-new:active { transform: scale(.98); background: var(--tb-accent-2); }
.tb-h { margin: 18px 4px 8px; font-size: 12px; font-weight: 500; color: var(--tb-sub); letter-spacing: .08em; }
.tb-h small { margin-left: 6px; }
.tb-card { position: relative; background: var(--tb-card); border: 1px solid var(--tb-line); border-radius: 16px; padding: 12px 14px 10px; margin-bottom: 9px; cursor: pointer; box-shadow: 0 1px 2px var(--tb-shadow); transition: transform .12s; }
.tb-card:active { transform: scale(.985); }
.tb-card.is-past { opacity: .8; }
.tb-card-top { display: flex; align-items: center; gap: 8px; }
.tb-card-top b { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-card-top em { flex: none; font-style: normal; font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--tb-accent-2); color: var(--tb-accent); }
.tb-card-top em.is-ok { background: rgba(111, 191, 154, .16); color: var(--tb-ok); }
.tb-card-top em.is-off { background: rgba(160, 140, 130, .15); color: var(--tb-sub); }
.tb-card p { margin: 3px 0 7px; font-size: 12.5px; color: var(--tb-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-bar { height: 4px; border-radius: 99px; background: var(--tb-accent-2); overflow: hidden; margin: 8px 0 5px; }
.tb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--tb-accent); transition: width .4s; }
.tb-card small { font-size: 11px; color: var(--tb-sub); }
.tb-card-del { position: absolute; right: 12px; bottom: 8px; border: 0; background: none; font-size: 11.5px; color: var(--tb-sub); cursor: pointer; padding: 4px; }

/* 弹层 */
.tb-sheet { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(25, 38, 46, 0); visibility: hidden; transition: background .25s, visibility .25s; }
.tb-sheet.is-open { visibility: visible; background: rgba(25, 38, 46, .36); }
.tb-sheet-card { width: 100%; max-width: 560px; box-sizing: border-box; background: var(--tb-card); border-radius: 22px 22px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 14px); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); }
.tb-sheet.is-open .tb-sheet-card { transform: translateY(0); }
.tb-sheet-card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.tb-hint { margin: -6px 0 10px; font-size: 12px; color: var(--tb-sub); }
.tb-input { width: 100%; box-sizing: border-box; border: 1px solid var(--tb-line); border-radius: 14px; padding: 10px 12px; font-size: 14.5px; background: var(--tb-bg); outline: none; margin-bottom: 9px; resize: none; line-height: 1.5; transition: border-color .2s; }
.tb-input:focus { border-color: var(--tb-accent); }
.tb-input[disabled] { opacity: .5; }
.tb-sheet-btns { display: flex; gap: 8px; margin-top: 4px; }
.tb-sheet-btns .tb-btn { flex: 1; }
.tb-sheet-btns .tb-btn.is-primary { flex: 1.6; }
.tb-menu { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tb-menu .tb-btn { padding: 12px; font-size: 14px; }
.tb-menu .tb-btn.is-soft { color: var(--tb-ink); }
.tb-usage { margin: 12px 2px 12px; font-size: 11.5px; line-height: 1.6; color: var(--tb-sub); }

/* 开关 */
.tb-sw { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--tb-line); cursor: pointer; }
.tb-sw > span { flex: 1; min-width: 0; }
.tb-sw b { display: block; font-size: 14px; font-weight: 500; }
.tb-sw small { display: block; font-size: 11.5px; color: var(--tb-sub); margin-top: 2px; line-height: 1.4; }
.tb-sw input { position: absolute; opacity: 0; pointer-events: none; }
.tb-sw i { flex: none; width: 40px; height: 24px; border-radius: 99px; background: var(--tb-line); position: relative; transition: background .2s; }
.tb-sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.tb-sw input:checked + i { background: var(--tb-accent); }
.tb-sw input:checked + i::after { transform: translateX(16px); }

/* 完成时的彩纸 */
.tb-confetti { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.tb-confetti i { position: absolute; top: -12px; width: 8px; height: 12px; opacity: 0; animation: tb-fall linear forwards; }
@keyframes tb-fall { 0% { opacity: 1; transform: translateY(0) translateX(0) rotate(0); } 100% { opacity: 0; transform: translateY(105vh) translateX(var(--sw)) rotate(540deg); } }

/* 开屏：小人沿台阶一步步跳上去，插上小旗 */
.tb-splash { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--tb-bg); transition: opacity .3s; }
.tb-splash.is-skip { opacity: 0; pointer-events: none; }
.tb-sp-stage { position: relative; width: 150px; height: 92px; margin-bottom: 18px; color: var(--tb-accent); }
.tb-sp-s { position: absolute; bottom: 0; left: calc(var(--i) * 36px); width: 30px; height: calc(20px + var(--i) * 16px); border-radius: 7px 7px 3px 3px; background: var(--tb-accent-2); border: 1.5px solid var(--tb-accent); opacity: 0; transform-origin: bottom; animation: tb-sp-rise .38s calc(var(--i) * .1s) cubic-bezier(.2, .9, .3, 1.3) forwards; }
@keyframes tb-sp-rise { 0% { opacity: 0; transform: scaleY(.2); } 100% { opacity: 1; transform: scaleY(1); } }
.tb-sp-hop { position: absolute; left: 2px; bottom: 22px; width: 26px; height: 26px; opacity: 0; animation: tb-sp-hop 1.5s .6s cubic-bezier(.4, 0, .4, 1) forwards; }
.tb-sp-hop .tb-av { width: 26px; height: 26px; display: flex; font-size: 12px; box-shadow: 0 0 0 2px var(--tb-card); }
@keyframes tb-sp-hop {
    0% { opacity: 0; transform: translate(0, 6px); }
    8% { opacity: 1; transform: translate(0, 0); }
    20% { transform: translate(18px, -30px); }
    32%, 40% { transform: translate(36px, -16px); }
    52% { transform: translate(54px, -46px); }
    64%, 72% { transform: translate(72px, -32px); }
    86% { transform: translate(90px, -64px); }
    100% { opacity: 1; transform: translate(108px, -48px); }
}
.tb-sp-flag { position: absolute; left: 111px; bottom: 70px; opacity: 0; transform-origin: 3px 22px; animation: tb-sp-flag .4s 2s cubic-bezier(.2, .9, .3, 1.4) forwards; }
@keyframes tb-sp-flag { 0% { opacity: 0; transform: scale(.2) rotate(-20deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.tb-sp-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: .24em; text-indent: .24em; color: var(--tb-ink); opacity: 0; animation: tb-sp-up .5s .5s ease-out forwards; }
.tb-sp-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--tb-sub); letter-spacing: .12em; opacity: 0; animation: tb-sp-up .5s .7s ease-out forwards; }
@keyframes tb-sp-up { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }

/* 拓展面板入口的小点 */
#task-buddy-btn .expansion-item-icon { position: relative; }
.tb-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #7f9aab; box-shadow: 0 0 0 2px #fff; }

@media (prefers-reduced-motion: reduce) {
    .tb-bg *, .tb-bubble.is-step, .tb-dot-b i, .tb-hello .tb-av, .tb-new, .sn-body, .sn-st { animation: none !important; }
    .tb-spark { opacity: .6; } .tb-snail { left: 58%; opacity: 1; transform: none; }
    .tb-row.is-fresh .tb-bubble, .tb-row.is-fresh .tb-bubble.is-step, .tb-sys.is-fresh span, .tb-bubble.is-typing i, .tb-page { animation: none !important; }
    .tb-sp-s, .tb-sp-title, .tb-sp-sub, .tb-sp-flag { animation-duration: .01s; animation-delay: 0s; }
    .tb-sp-hop { animation: none; opacity: 1; transform: translate(108px, -48px); }
}
