.tm-camp-fox-fab {
    position: fixed;
    z-index: 10058;
    right: 22px;
    left: auto;
    bottom: 108px;
    width: 88px;
    height: 88px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.tm-camp-fox-fab.is-wait::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff8ee;
    border-radius: 50%;
    background: #e07a3d;
}
.tm-camp-fox-fab.is-wait img {
    animation: tmCampFoxBounce 1.5s ease infinite;
}
.tm-camp-fox-fab img {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 26px;
    box-shadow: 0 12px 28px rgba(45, 90, 110, 0.38);
    pointer-events: none;
}
.tm-camp-fox-fab.is-talk img {
    animation: tmCampFoxBounce 0.7s ease 2;
}
@keyframes tmCampFoxBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
body.is-focus-overlay .tm-camp-fox-fab,
body.is-focus-overlay .tm-camp-fox-layer,
body.tm-rs-chat-open .tm-camp-fox-fab,
body.tm-rs-chat-open .tm-camp-fox-layer {
    display: none !important;
}

.tm-camp-fox-layer {
    position: fixed;
    z-index: 10130;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    pointer-events: none;
}
.tm-camp-fox-layer.is-open {
    display: block;
}

/* App WebView / 嵌入页：对话铺满舞台，隐藏浮动头像与缩放把手 */
body.tm-fox-embed .tm-camp-fox-fab {
    display: none !important;
}
body.tm-fox-embed .tm-camp-fox-layer {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    z-index: 1;
}
body.tm-fox-embed .tm-camp-fox-layer.is-open {
    display: block;
}
body.tm-fox-embed .tm-camp-fox-panel {
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    border-radius: 18px;
}
body.tm-fox-embed .tm-camp-fox-panel.is-sized {
    width: 100%;
    height: 100%;
}
body.tm-fox-embed .tm-camp-fox-resize {
    display: none !important;
}
@media (max-width: 700px) {
    body.tm-fox-embed .tm-camp-fox-panel {
        grid-template-columns: 96px minmax(0, 1fr);
        margin: 0;
        height: 100%;
    }
}
.tm-camp-fox-panel {
    pointer-events: auto;
    position: relative;
    margin: 0 16px 24px auto;
    width: min(560px, calc(100vw - 24px));
    height: min(78vh, 540px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 48px);
    min-width: 300px;
    min-height: 280px;
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    color: #3d2a1a;
    border: 2px solid #f2c38a;
    border-radius: 22px;
    background: #fff8ee;
    box-shadow: 0 18px 40px rgba(80, 48, 20, 0.18);
    overflow: hidden;
}
.tm-camp-fox-panel.is-sized {
    width: var(--tm-fox-w, min(560px, calc(100vw - 24px)));
    height: var(--tm-fox-h, min(78vh, 540px));
}
.tm-camp-fox-panel.is-resizing {
    user-select: none;
    transition: none;
}
.tm-camp-fox-resize {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 22px 0 14px 0;
    background:
        linear-gradient(135deg, transparent 42%, rgba(192, 120, 64, 0.55) 42%, rgba(192, 120, 64, 0.55) 50%, transparent 50%),
        linear-gradient(135deg, transparent 58%, rgba(192, 120, 64, 0.35) 58%, rgba(192, 120, 64, 0.35) 66%, transparent 66%);
    background-color: rgba(255, 248, 238, 0.72);
    cursor: nwse-resize;
    touch-action: none;
}
.tm-camp-fox-resize:hover,
.tm-camp-fox-resize:focus-visible {
    background-color: #ffe7cc;
    outline: none;
}
.tm-camp-fox-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff8ee;
    padding: 8px 4px 4px;
}
.tm-camp-fox-sprite {
    display: block;
    width: 88%;
    height: auto;
    max-height: 88%;
    object-fit: contain;
    object-position: center bottom;
    mix-blend-mode: multiply;
    background: transparent;
    border-radius: 28px;
}
.tm-camp-fox-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff8ee;
}
.tm-camp-fox-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(242, 195, 138, 0.45);
    flex-shrink: 0;
}
.tm-camp-fox-nameplate small {
    display: block;
    font-size: 11px;
    color: #c07840;
}
.tm-camp-fox-nameplate b {
    font-size: 18px;
}
.tm-camp-fox-persona {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: #c07840;
    font-weight: 500;
}
.tm-camp-fox-persona select {
    border: 1px solid #f2c38a;
    background: #fff;
    color: #8a4b22;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.tm-camp-fox-stickers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    margin-left: 8px;
    font-size: 12px;
    color: #c07840;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.tm-camp-fox-stickers input {
    width: 14px;
    height: 14px;
    accent-color: #d97706;
    cursor: pointer;
}
.tm-camp-fox-assist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 8px;
}
.tm-camp-fox-assist-btn {
    border: 1px solid #f2c38a;
    background: #fff8f0;
    color: #8a4b22;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.3;
}
.tm-camp-fox-assist-btn.is-on {
    background: #f4a261;
    border-color: #e08a3c;
    color: #fff;
}
.tm-camp-fox-ask-focus {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 8px;
}
.tm-camp-fox-focus-btn {
    border: 1px solid #f2c38a;
    background: #fff8f0;
    color: #8a4b22;
    border-radius: 10px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
    line-height: 1.3;
}
.tm-camp-fox-focus-btn.is-on {
    background: #f4a261;
    border-color: #e08a3c;
    color: #fff;
}
.tm-camp-fox-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 2px;
}
.tm-camp-fox-tools button {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #8a5a38;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    padding: 0;
}
.tm-camp-fox-tools button:hover,
.tm-camp-fox-tools button:focus-visible {
    background: rgba(242, 195, 138, 0.35);
    color: #6b3d1f;
}
.tm-camp-fox-tools .tm-camp-fox-clear {
    color: #a06a42;
}
.tm-camp-fox-tools .tm-camp-fox-clear svg {
    display: block;
}
.tm-camp-fox-scroll-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.tm-camp-fox-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.tm-camp-fox-jump {
    position: absolute;
    right: 10px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tm-camp-fox-jump-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(80, 60, 40, 0.18);
    background: rgba(255, 252, 245, 0.92);
    color: #6a5544;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(40, 28, 16, 0.12);
    padding: 0;
}
.tm-camp-fox-jump-btn:hover {
    background: #fff;
    color: #3d2e22;
}
.tm-camp-fox-jump-btn:active {
    transform: scale(0.96);
}
.tm-camp-fox-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tm-camp-fox-msg {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.tm-camp-fox-msg.is-user {
    flex-direction: row-reverse;
}
.tm-camp-fox-msg-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 28px;
    background: #d8f1f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #5a6a72;
}
.tm-camp-fox-msg-av.is-letter {
    background: #e8eef2;
}
.tm-camp-fox-msg-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tm-camp-fox-msg-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: 82%;
}
.tm-camp-fox-msg.is-user .tm-camp-fox-msg-col {
    align-items: flex-end;
}
.tm-camp-fox-msg-col .tm-camp-ai-draft {
    max-width: 100%;
    margin-top: 4px;
    font-size: 13px;
}
.tm-camp-fox-sticker {
    display: block;
    width: 88px;
    height: auto;
    border-radius: 14px;
    mix-blend-mode: multiply;
}
.tm-camp-fox-bubble {
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 14px 14px 14px 4px;
    background: #fff;
    border: 1px solid rgba(242, 195, 138, 0.4);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.tm-camp-fox-msg.is-user .tm-camp-fox-bubble {
    border-radius: 14px 14px 4px 14px;
    background: #ffe7cc;
}
.tm-camp-fox-bubble.is-overdue {
    background: #fff1ec;
}
.tm-camp-fox-bubble.is-praise {
    background: #eefaf3;
}
.tm-camp-fox-resend {
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(242, 195, 138, 0.35);
    color: #9a5b24;
    font-size: 12px;
    cursor: pointer;
}
.tm-camp-fox-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #b0845c;
}
.tm-camp-fox-nudgebar {
    display: flex;
    gap: 8px;
    padding: 0 12px 10px;
    flex-shrink: 0;
}
.tm-camp-fox-nudgebar button {
    flex: 1;
    border: 1px solid #f0b27a;
    background: #fff;
    color: #8a4b22;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.tm-camp-fox-nudgebar button.primary {
    background: #e07a3d;
    border-color: #e07a3d;
    color: #fff;
}
.tm-camp-fox-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(242, 195, 138, 0.4);
    flex-shrink: 0;
    background: #fff8ee;
}
.tm-camp-fox-input-row textarea {
    flex: 1;
    min-height: 44px;
    max-height: 88px;
    resize: none;
    border: 1px solid #f2c38a;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.45;
    color-scheme: light;
    background: #fff;
    color: #3d2a1a;
    -webkit-text-fill-color: #3d2a1a;
    caret-color: #3d2a1a;
}
.tm-camp-fox-input-row textarea::placeholder {
    color: #a08060;
    -webkit-text-fill-color: #a08060;
    opacity: 1;
}
.tm-camp-fox-input-row button {
    border: 0;
    border-radius: 12px;
    background: #3db8c8;
    color: #fff;
    font-weight: 700;
    padding: 0 14px;
    cursor: pointer;
}

@media (max-width: 700px) {
    .tm-camp-fox-fab {
        right: 14px;
        bottom: calc(72px + var(--tm-mobile-bar-offset, 56px));
        width: 80px;
        height: 80px;
    }
    .tm-camp-fox-fab img {
        width: 80px;
        height: 80px;
    }
    .tm-camp-fox-panel {
        margin: 0 10px 12px;
        grid-template-columns: 108px minmax(0, 1fr);
        height: min(74vh, 520px);
        min-width: min(300px, calc(100vw - 20px));
    }
    .tm-camp-fox-panel.is-sized {
        width: min(var(--tm-fox-w, 100%), calc(100vw - 20px));
        height: min(var(--tm-fox-h, 74vh), calc(100vh - 36px));
    }
    .tm-camp-fox-resize {
        width: 28px;
        height: 28px;
    }
}
