.zcw-widget,
.zcw-widget * {
    box-sizing: border-box;
}

.zcw-widget {
    --zcw-bg: #1f2024;
    --zcw-panel: #25272d;
    --zcw-panel-2: #2f3138;
    --zcw-border: rgba(255, 255, 255, 0.1);
    --zcw-text: #f2f3f5;
    --zcw-muted: #b5bac1;
    --zcw-primary: var(--theme-color, #23aeea);
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

.zcw-launcher {
    min-width: 56px;
    height: 56px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--zcw-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.zcw-launcher:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
}

.zcw-launcher:focus-visible,
.zcw-icon-btn:focus-visible {
    outline: 2px solid rgba(35, 174, 234, 0.45);
    outline-offset: 2px;
}

.zcw-launcher i {
    font-size: 20px;
}

.zcw-widget--open .zcw-launcher {
    display: none;
}

.zcw-panel[hidden] {
    display: none;
}

.zcw-panel {
    width: min(420px, calc(100vw - 32px));
    height: min(640px, calc(100vh - 48px));
    background: var(--zcw-bg);
    color: var(--zcw-text);
    border: 1px solid var(--zcw-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

.zcw-widget--fullscreen .zcw-panel {
    width: min(960px, calc(100vw - 32px));
    height: min(820px, calc(100vh - 32px));
}

.zcw-panel__header {
    height: 48px;
    min-height: 48px;
    padding: 0 10px;
    background: var(--zcw-bg);
    border-bottom: 1px solid var(--zcw-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.zcw-panel__title {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--zcw-text);
    font-size: 16px;
    font-weight: 700;
}

.zcw-panel__title i {
    color: var(--zcw-primary);
    font-size: 18px;
}

.zcw-panel__title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zcw-panel__actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.zcw-icon-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--zcw-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}

.zcw-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--zcw-text);
}

.zcw-panel__body {
    flex: 1;
    min-height: 0;
    position: relative;
    background: var(--zcw-panel);
}

.zcw-panel__frame {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: var(--zcw-panel);
}

.zcw-panel__loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--zcw-muted);
    background: var(--zcw-panel);
    font-size: 14px;
}

.zcw-panel--loaded .zcw-panel__loading {
    display: none;
}

.zcw-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(0, 0, 0, 0.84);
}

.zcw-image-viewer.is-active {
    display: flex;
}

.zcw-image-viewer__body {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zcw-image-viewer__img {
    display: block;
    max-width: calc(100vw - 64px);
    max-height: calc(100vh - 64px);
    width: auto;
    height: auto;
    border-radius: 8px;
    background: #25272d;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.52);
}

.zcw-image-viewer__close {
    position: fixed;
    top: 22px;
    right: 22px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.zcw-image-viewer__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 520px) {
    .zcw-widget {
        right: 10px;
        bottom: 10px;
    }

    .zcw-launcher {
        width: 56px;
        padding: 0;
    }

    .zcw-launcher__label {
        display: none;
    }

    .zcw-panel,
    .zcw-widget--fullscreen .zcw-panel {
        width: calc(100vw - 20px);
        height: min(680px, calc(100vh - 20px));
    }

    .zcw-image-viewer {
        padding: 16px;
    }

    .zcw-image-viewer__img {
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
    }

    .zcw-image-viewer__close {
        top: 14px;
        right: 14px;
    }
}
