#yunshang-chatroom-root {
    position: relative;
    z-index: 9997;
}

.ys-chatroom {
    --ys-chat-accent-a: #ff6f91;
    --ys-chat-accent-b: #7bdff2;
    --ys-chat-head-a: rgba(30, 41, 59, 0.9);
    --ys-chat-head-b: rgba(15, 23, 42, 0.84);
    --ys-chat-panel-a: rgba(255, 255, 255, 0.92);
    --ys-chat-panel-b: rgba(244, 249, 255, 0.88);
    --ys-chat-main-bg: rgba(255, 255, 255, 0.8);
    --ys-chat-main-border: rgba(15, 23, 42, 0.1);
    --ys-chat-snap-duration: 320ms;
    --ys-chat-snap-ease: cubic-bezier(0.22, 0.82, 0.26, 1.08);
    position: fixed;
    right: 14px;
    bottom: 96px;
    width: 320px;
    max-width: calc(100vw - 24px);
    color: #0f172a;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    pointer-events: auto;
}

.ys-chatroom.is-left {
    left: 14px;
    right: auto;
}

.ys-chatroom.is-hidden .ys-chatroom-panel {
    display: none;
}

.ys-chatroom-bubble {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--ys-chat-accent-a), var(--ys-chat-accent-b));
    color: #fff;
    font-size: 20px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.25);
    cursor: pointer;
}

.ys-chatroom.is-left .ys-chatroom-bubble {
    left: 0;
    right: auto;
}

.ys-chatroom-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 420px;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 66px;
    background: linear-gradient(145deg, var(--ys-chat-panel-a), var(--ys-chat-panel-b));
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: transform 0.24s ease, opacity 0.24s ease, box-shadow 0.24s ease;
}

.ys-chatroom-panel.is-collapsed {
    height: 52px;
}

.ys-chatroom-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    color: #fff;
    background: linear-gradient(120deg, var(--ys-chat-head-a), var(--ys-chat-head-b));
    cursor: move;
}

.ys-chatroom-head-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ys-chatroom-head-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ys-chatroom-head-copy strong {
    font-size: 15px;
    line-height: 1.2;
}

.ys-chatroom-head-copy span {
    font-size: 11px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.78);
}

.ys-chatroom-head-motion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    white-space: nowrap;
    pointer-events: none;
}

.ys-chatroom-head-motion.motion-steady {
    background: rgba(14, 116, 144, 0.32);
}

.ys-chatroom-head-motion.motion-balanced {
    background: rgba(15, 118, 110, 0.3);
}

.ys-chatroom-head-motion.motion-agile {
    background: rgba(245, 158, 11, 0.28);
}

.ys-chatroom-head-motion.is-clickable {
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ys-chatroom-head-motion.is-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

.ys-chatroom-head-motion.is-clickable.is-pressing {
    transform: scale(0.96);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16) inset;
}

.ys-chatroom-head-motion.is-clickable.is-temporary {
    border-color: rgba(250, 204, 21, 0.82);
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.22);
}

.ys-chatroom-head-motion.is-clickable.is-temporary.is-urgent {
    animation: ys-chatroom-motion-urgent 0.9s ease-in-out infinite;
}

@keyframes ys-chatroom-motion-urgent {
    0% {
        box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.18);
        border-color: rgba(250, 204, 21, 0.68);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.26);
        border-color: rgba(248, 113, 113, 0.92);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.18);
        border-color: rgba(250, 204, 21, 0.68);
    }
}

.ys-chatroom-mobile-badge {
    display: none;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.ys-chatroom-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ys-chatroom-head button:not(.ys-chatroom-head-motion) {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}

.ys-chatroom-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.ys-chatroom-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 8px;
    align-items: flex-start;
}

.ys-chatroom-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    object-fit: cover;
}

.ys-chatroom-avatar.is-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #475569;
}

.ys-chatroom-main {
    border-radius: 12px;
    background: var(--ys-chat-main-bg);
    border: 1px solid var(--ys-chat-main-border);
    padding: 8px 10px;
}

.ys-chatroom-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #64748b;
}

.ys-chatroom-content {
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.ys-chatroom-image-wrap {
    margin-top: 6px;
}

.ys-chatroom-image {
    display: block;
    max-width: 100%;
    max-height: 220px;
    border-radius: 10px;
}

.ys-chatroom-empty {
    margin: 12px 0;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.ys-chatroom-tip {
    min-height: 20px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 20px;
    color: #64748b;
}

.ys-chatroom-tip.is-success {
    color: #047857;
}

.ys-chatroom-tip.is-error {
    color: #b91c1c;
}

.ys-chatroom-tip.is-warning {
    color: #b45309;
}

.ys-chatroom .ys-chatroom-admin-batch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.62);
    min-height: 34px;
}

.ys-chatroom .ys-chatroom-admin-batch-count {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-right: 4px;
}

.ys-chatroom .ys-chatroom-admin-mode-toggle,
.ys-chatroom .ys-chatroom-admin-batch-btn,
.ys-chatroom .ys-chatroom-admin-batch-clear,
.ys-chatroom .ys-chatroom-admin-action {
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    border-radius: 999px;
    padding: 2px 9px !important;
    min-height: 24px;
    line-height: 1.2;
    font-size: 11px !important;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    outline: none;
}

.ys-chatroom .ys-chatroom-admin-mode-toggle {
    background: rgba(15, 118, 110, 0.14) !important;
    color: #0f766e !important;
}

.ys-chatroom .ys-chatroom-admin-batch-btn,
.ys-chatroom .ys-chatroom-admin-batch-clear {
    background: rgba(15, 23, 42, 0.08) !important;
    color: #334155 !important;
}

.ys-chatroom .ys-chatroom-admin-batch.has-selection .ys-chatroom-admin-batch-count {
    color: #047857;
}

.ys-chatroom .ys-chatroom-admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(148, 163, 184, 0.34);
}

.ys-chatroom .ys-chatroom-admin-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #475569;
}

.ys-chatroom .ys-chatroom-admin-action {
    background: rgba(15, 118, 110, 0.12) !important;
    color: #0f766e !important;
}

.ys-chatroom .ys-chatroom-admin-action:hover,
.ys-chatroom .ys-chatroom-admin-batch-btn:hover,
.ys-chatroom .ys-chatroom-admin-batch-clear:hover,
.ys-chatroom .ys-chatroom-admin-mode-toggle:hover {
    filter: brightness(0.95);
}

.ys-chatroom:not(.is-admin-tools-open) .ys-chatroom-admin-actions,
.ys-chatroom:not(.is-admin-tools-open) .ys-chatroom-admin-batch-btn,
.ys-chatroom:not(.is-admin-tools-open) .ys-chatroom-admin-batch-clear,
.ys-chatroom:not(.is-admin-tools-open) .ys-chatroom-admin-batch-count {
    display: none;
}

.ys-chatroom.is-admin-tools-open .ys-chatroom-admin-batch {
    padding-top: 7px;
    padding-bottom: 7px;
}

@media (max-width: 767px) {
    .ys-chatroom .ys-chatroom-admin-batch {
        gap: 4px;
        padding: 6px;
    }

    .ys-chatroom .ys-chatroom-admin-actions {
        gap: 4px;
    }

    .ys-chatroom .ys-chatroom-admin-batch-btn,
    .ys-chatroom .ys-chatroom-admin-batch-clear,
    .ys-chatroom .ys-chatroom-admin-action,
    .ys-chatroom .ys-chatroom-admin-mode-toggle {
        font-size: 10px !important;
        min-height: 22px;
        padding: 2px 7px !important;
    }
}

.ys-chatroom-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding: 8px;
    background: rgba(255, 255, 255, 0.64);
}

.ys-chatroom-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ys-chatroom-upload {
    position: relative;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.ys-chatroom-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ys-chatroom-upload.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ys-chatroom-input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 10px;
    padding: 8px;
    resize: vertical;
    min-height: 52px;
    max-height: 120px;
    font-size: 13px;
}

.ys-chatroom-send {
    margin-top: 6px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 8px 10px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(120deg, var(--ys-chat-accent-a), var(--ys-chat-accent-b));
}

.ys-chatroom-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ys-chatroom.is-dragging {
    user-select: none;
    opacity: 0.95;
}

.ys-chatroom:hover .ys-chatroom-panel {
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.24);
}

.ys-chatroom.is-snapping .ys-chatroom-panel {
    animation: ys-chatroom-snap var(--ys-chat-snap-duration) var(--ys-chat-snap-ease);
}

.ys-chatroom.is-snapping-left .ys-chatroom-panel {
    animation: ys-chatroom-snap-left var(--ys-chat-snap-duration) var(--ys-chat-snap-ease);
}

.ys-chatroom.is-snapping-right .ys-chatroom-panel {
    animation: ys-chatroom-snap-right var(--ys-chat-snap-duration) var(--ys-chat-snap-ease);
}

.ys-chatroom.is-snapping-top .ys-chatroom-panel {
    animation: ys-chatroom-snap-top var(--ys-chat-snap-duration) var(--ys-chat-snap-ease);
}

.ys-chatroom.is-snapping-bottom .ys-chatroom-panel {
    animation: ys-chatroom-snap-bottom var(--ys-chat-snap-duration) var(--ys-chat-snap-ease);
}

.ys-chatroom.is-skin-aurora {
    --ys-chat-accent-a: #12b886;
    --ys-chat-accent-b: #4dabf7;
    --ys-chat-head-a: rgba(7, 59, 76, 0.92);
    --ys-chat-head-b: rgba(10, 25, 41, 0.86);
    --ys-chat-panel-a: rgba(239, 255, 250, 0.92);
    --ys-chat-panel-b: rgba(234, 246, 255, 0.9);
    --ys-chat-main-bg: rgba(255, 255, 255, 0.76);
    --ys-chat-main-border: rgba(18, 184, 134, 0.2);
}

.ys-chatroom.is-skin-sunset {
    --ys-chat-accent-a: #f97316;
    --ys-chat-accent-b: #ef4444;
    --ys-chat-head-a: rgba(124, 45, 18, 0.9);
    --ys-chat-head-b: rgba(127, 29, 29, 0.84);
    --ys-chat-panel-a: rgba(255, 244, 232, 0.94);
    --ys-chat-panel-b: rgba(255, 238, 238, 0.9);
    --ys-chat-main-bg: rgba(255, 255, 255, 0.74);
    --ys-chat-main-border: rgba(249, 115, 22, 0.2);
}

.ys-chatroom.is-skin-graphite {
    --ys-chat-accent-a: #475569;
    --ys-chat-accent-b: #0f172a;
    --ys-chat-head-a: rgba(15, 23, 42, 0.94);
    --ys-chat-head-b: rgba(2, 6, 23, 0.88);
    --ys-chat-panel-a: rgba(30, 41, 59, 0.92);
    --ys-chat-panel-b: rgba(15, 23, 42, 0.9);
    --ys-chat-main-bg: rgba(51, 65, 85, 0.62);
    --ys-chat-main-border: rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
}

.ys-chatroom.is-skin-graphite .ys-chatroom-meta,
.ys-chatroom.is-skin-graphite .ys-chatroom-empty,
.ys-chatroom.is-skin-graphite .ys-chatroom-tip {
    color: #cbd5e1;
}

.ys-chatroom.is-skin-graphite .ys-chatroom-upload,
.ys-chatroom.is-skin-graphite .ys-chatroom-input {
    background: rgba(15, 23, 42, 0.58);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.28);
}

@media (max-width: 767px) {
    .ys-chatroom {
        width: min(88vw, 360px);
        right: 8px;
        left: auto;
        bottom: 84px;
    }

    .ys-chatroom.is-left {
        left: 8px;
        right: auto;
    }

    .ys-chatroom-panel {
        height: min(68vh, 520px);
        margin-bottom: 58px;
        border-radius: 20px;
    }

    .ys-chatroom-bubble {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .ys-chatroom-head {
        padding: 12px;
    }

    .ys-chatroom-head-copy strong {
        font-size: 14px;
    }

    .ys-chatroom-head-copy span {
        display: block;
    }

    .ys-chatroom-messages {
        padding: 8px;
        gap: 7px;
    }

    .ys-chatroom-main {
        padding: 8px 9px;
    }

    .ys-chatroom-footer {
        padding: 7px;
        background: rgba(255, 255, 255, 0.74);
    }

    .ys-chatroom-tools {
        gap: 6px;
        flex-wrap: wrap;
    }

    .ys-chatroom-upload {
        padding: 5px 10px;
    }

    .ys-chatroom.is-mobile-floating-mode,
    .ys-chatroom.is-mobile-floating-mode.is-left,
    .ys-chatroom.is-mobile-floating-mode.is-right {
        left: 10px;
        right: auto;
        bottom: 122px;
        width: min(88vw, 360px);
        max-width: calc(100vw - 20px);
        z-index: 9998;
        touch-action: none;
        user-select: none;
        cursor: grab;
        transition: left var(--ys-chat-snap-duration) var(--ys-chat-snap-ease), top var(--ys-chat-snap-duration) var(--ys-chat-snap-ease);
    }

    .ys-chatroom.is-mobile-floating-mode.is-dragging {
        cursor: grabbing;
        transition: none;
    }

    .ys-chatroom.is-mobile-floating-mode:not(.is-hidden) .ys-chatroom-bubble {
        display: none;
    }

    .ys-chatroom.is-mobile-floating-mode .ys-chatroom-panel {
        margin-bottom: 0;
        height: min(66vh, 500px);
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.26);
    }

    .ys-chatroom.is-mobile-floating-mode .ys-chatroom-mobile-badge {
        display: inline-flex;
    }

    .ys-chatroom.is-mobile-floating-mode .ys-chatroom-head {
        padding: 12px 13px;
    }

    .ys-chatroom.is-mobile-floating-mode .ys-chatroom-head-actions {
        gap: 5px;
    }

    .ys-chatroom.is-mobile-floating-mode .ys-chatroom-head button:not(.ys-chatroom-head-motion) {
        width: 26px;
        height: 26px;
    }

    .ys-chatroom.is-mobile-floating-mode .ys-chatroom-head-motion {
        width: auto;
        height: auto;
        min-height: 24px;
    }

    .ys-chatroom.is-mobile-floating-mode .ys-chatroom-messages {
        max-height: none;
    }

    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed {
        width: auto;
        max-width: none;
        cursor: pointer;
    }

    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-panel {
        width: 68px;
        height: 68px;
        min-height: 68px;
        overflow: hidden;
        margin-bottom: 0;
        border-radius: 22px;
        box-shadow: 0 22px 42px rgba(15, 23, 42, 0.26);
    }

    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-head {
        min-width: 68px;
        min-height: 68px;
        padding: 12px;
        justify-content: center;
        border-radius: 22px;
    }

    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-head-copy,
    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-head-motion,
    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-head-actions,
    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-messages,
    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-tip,
    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-footer {
        display: none;
    }

    .ys-chatroom.is-mobile-floating-mode.is-mobile-collapsed .ys-chatroom-mobile-badge {
        display: inline-flex;
        width: 40px;
        height: 40px;
        margin: 0;
        font-size: 16px;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.28);
    }


@keyframes ys-chatroom-snap {
    0% { transform: translateY(4px) scale(0.95); }
    65% { transform: translateY(-2px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes ys-chatroom-snap-left {
    0% { transform: translateX(-16px) scale(0.95); }
    70% { transform: translateX(5px) scale(1.015); }
    100% { transform: translateX(0) scale(1); }
}

@keyframes ys-chatroom-snap-right {
    0% { transform: translateX(16px) scale(0.95); }
    70% { transform: translateX(-5px) scale(1.015); }
    100% { transform: translateX(0) scale(1); }
}

@keyframes ys-chatroom-snap-top {
    0% { transform: translateY(-16px) scale(0.95); }
    70% { transform: translateY(4px) scale(1.015); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes ys-chatroom-snap-bottom {
    0% { transform: translateY(16px) scale(0.95); }
    70% { transform: translateY(-4px) scale(1.015); }
    100% { transform: translateY(0) scale(1); }
}
}
