/* reverse-invasion.css — 反向入侵：设置卡 / 顶栏横幅 / 屏蔽层 / 聊天回执气泡（由 style.css 拆出） */

/* ===================== 反向入侵设置卡（Char 手机·设置·桌面背景下方） ===================== */
.phone-settings-reverse-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phone-settings-reverse-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.phone-settings-reverse-title-wrap {
    flex: 1;
    min-width: 0;
}

.phone-settings-reverse-switch {
    flex-shrink: 0;
    position: relative;
    width: 42px;
    height: 24px;
    display: inline-block;
    cursor: pointer;
}

.phone-settings-reverse-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.phone-settings-reverse-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(120, 130, 140, 0.32);
    transition: background 0.18s ease;
}

.phone-settings-reverse-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease;
}

.phone-settings-reverse-switch input:checked + .phone-settings-reverse-switch-track {
    background: linear-gradient(135deg, #FF6B8A 0%, #FF9A6B 100%);
}

.phone-settings-reverse-switch input:checked + .phone-settings-reverse-switch-track::after {
    transform: translateX(18px);
}

.phone-settings-reverse-collapse-btn {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(120, 130, 140, 0.22);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.phone-settings-reverse-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.phone-settings-reverse-collapse-arrow {
    transition: transform 0.18s ease;
    display: inline-block;
}

.phone-settings-reverse-collapse-arrow.is-open {
    transform: rotate(180deg);
}

.phone-settings-reverse-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 4px 4px;
    border-top: 1px dashed rgba(120, 130, 140, 0.22);
}

.phone-settings-reverse-body[hidden] {
    display: none;
}

.phone-settings-reverse-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.phone-settings-reverse-label {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.phone-settings-reverse-depth-actions {
    display: inline-flex;
    gap: 6px;
}

.phone-settings-reverse-depth-btn {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(120, 130, 140, 0.24);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    color: #555;
    cursor: pointer;
}

.phone-settings-reverse-depth-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

.phone-settings-reverse-interval {
    width: 110px;
    padding: 6px 10px;
    border: 1px solid rgba(120, 130, 140, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    color: #222;
}

.phone-settings-reverse-hint {
    font-size: 11.5px;
    color: rgba(60, 60, 70, 0.62);
    line-height: 1.45;
}

.phone-settings-reverse-depth-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 10px;
}

.phone-settings-reverse-depth-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(120, 130, 140, 0.18);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.35;
}

.phone-settings-reverse-depth-item input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #FF6B8A;
}

.phone-settings-reverse-depth-name {
    color: #333;
    font-weight: 600;
    flex: 1;
}

.phone-settings-reverse-depth-sub {
    display: block;
    width: 100%;
    color: rgba(60, 60, 70, 0.55);
    font-size: 11px;
    font-weight: 400;
    margin-left: 22px;
    margin-top: 2px;
}

.phone-settings-reverse-depth-item:has(input:checked) {
    background: linear-gradient(135deg, rgba(255, 107, 138, 0.15) 0%, rgba(255, 154, 107, 0.12) 100%);
    border-color: rgba(255, 107, 138, 0.42);
}

/* ===================== 反向入侵 · 顶部状态条 + 透明输入屏蔽层 ===================== */

/* 透明屏蔽层：覆盖整屏，吃掉所有点击/触摸事件，但 User 仍能"看见"下方页面被 Char 操作 */
.reverse-invasion-block-layer {
    position: fixed;
    inset: 0;
    z-index: 1000040;
    background: transparent;
    pointer-events: auto;
    cursor: not-allowed;
}

html.reverse-invasion-active {
    /* 阻止键盘选区 / 文本选中，强化"被锁定"感 */
    user-select: none;
    -webkit-user-select: none;
}

html.reverse-invasion-active body {
    overflow: hidden;
}

/* 顶部状态条 */
.reverse-invasion-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, -120%);
    z-index: 1000060;
    width: min(420px, calc(100vw - 24px));
    pointer-events: auto;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.reverse-invasion-banner.is-open {
    transform: translate(-50%, 0);
}

.reverse-invasion-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(48, 18, 38, 0.96) 0%, rgba(38, 12, 38, 0.96) 100%);
    border: 1px solid rgba(255, 107, 138, 0.42);
    box-shadow: 0 10px 28px rgba(20, 0, 30, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.reverse-invasion-banner-pulse {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF6B8A;
    box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.7);
    animation: reverse-invasion-pulse 1.2s ease-in-out infinite;
}

@keyframes reverse-invasion-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.55); transform: scale(1); }
    70%  { box-shadow: 0 0 0 12px rgba(255, 107, 138, 0); transform: scale(1.08); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0); transform: scale(1); }
}

.reverse-invasion-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.35;
}

.reverse-invasion-banner-title {
    font-size: 11.5px;
    letter-spacing: 0.1em;
    font-weight: 800;
    color: #FFD0DC;
    text-transform: uppercase;
}

.reverse-invasion-banner-status {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.4;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.reverse-invasion-banner-skip {
    flex-shrink: 0;
    background: linear-gradient(135deg, #FF6B8A 0%, #FF9A6B 100%);
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.35);
}

.reverse-invasion-banner-skip:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .reverse-invasion-banner {
        top: 8px;
        width: calc(100vw - 16px);
    }
    .phone-settings-reverse-depth-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   反向入侵·真实操作回执（可折叠卡片）
   --------------------------------------------------------------
   覆盖普通微信气泡的字数限制：完整记录 Char 在 User 手机上的
   每一步浏览、看到的内容、实际执行的动作。默认折叠，点击展开。
   ============================================================ */
.chat-message-bubble--reverse-invasion-receipt {
    background: transparent !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100%;
    box-shadow: none !important;
}

.chat-message-bubble--reverse-invasion-receipt .rir-card {
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(255, 246, 247, 0.95), rgba(243, 232, 255, 0.92));
    border: 1px solid rgba(255, 110, 130, 0.22);
    box-shadow: 0 6px 18px rgba(255, 110, 130, 0.12);
    overflow: hidden;
}

.chat-message-bubble--reverse-invasion-receipt .rir-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: #4a2030;
    transition: background-color 0.18s ease;
}

.chat-message-bubble--reverse-invasion-receipt .rir-head:hover {
    background-color: rgba(255, 200, 210, 0.25);
}

.chat-message-bubble--reverse-invasion-receipt .rir-head-badge {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff6b81, #c071ff);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(255, 107, 129, 0.32);
}

.chat-message-bubble--reverse-invasion-receipt .rir-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-message-bubble--reverse-invasion-receipt .rir-head-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d1023;
    line-height: 1.35;
}

.chat-message-bubble--reverse-invasion-receipt .rir-head-summary {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #5b3142;
    /* 折叠时摘要最多两行，避免标题区过高 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.chat-message-bubble--reverse-invasion-receipt .rir-head-ts {
    margin-top: 4px;
    font-size: 11px;
    color: #8c5f70;
    opacity: 0.85;
}

.chat-message-bubble--reverse-invasion-receipt .rir-head-arrow {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    color: #ad2d4d;
    font-size: 12px;
    transition: transform 0.22s ease;
}

.chat-message-bubble--reverse-invasion-receipt .rir-card:not([data-collapsed="1"]) .rir-head-arrow {
    transform: rotate(180deg);
}

.chat-message-bubble--reverse-invasion-receipt .rir-card:not([data-collapsed="1"]) .rir-head-summary {
    -webkit-line-clamp: unset;
    display: block;
}

.chat-message-bubble--reverse-invasion-receipt .rir-body {
    padding: 4px 14px 14px;
    border-top: 1px dashed rgba(255, 110, 130, 0.25);
    background: rgba(255, 252, 253, 0.65);
    color: #3a1c2c;
    font-size: 13px;
    line-height: 1.55;
}

.chat-message-bubble--reverse-invasion-receipt .rir-body[hidden] {
    display: none;
}

.chat-message-bubble--reverse-invasion-receipt .rir-section {
    margin-top: 10px;
}

.chat-message-bubble--reverse-invasion-receipt .rir-section:first-child {
    margin-top: 8px;
}

.chat-message-bubble--reverse-invasion-receipt .rir-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #ad2d4d;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.chat-message-bubble--reverse-invasion-receipt .rir-line {
    margin: 2px 0;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-message-bubble--reverse-invasion-receipt .rir-open {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 110, 130, 0.14);
}

.chat-message-bubble--reverse-invasion-receipt .rir-open-name {
    font-weight: 600;
    color: #6b1c3c;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.chat-message-bubble--reverse-invasion-receipt .rir-open-narration {
    color: #4a2030;
    font-size: 12.5px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-message-bubble--reverse-invasion-receipt .rir-open-actions {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-message-bubble--reverse-invasion-receipt .rir-action {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 235, 240, 0.85);
    border-left: 3px solid #ff6b81;
    font-size: 12.5px;
    line-height: 1.45;
}

.chat-message-bubble--reverse-invasion-receipt .rir-action-kind {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    background: #ff6b81;
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: 1px;
}

.chat-message-bubble--reverse-invasion-receipt .rir-action-content {
    margin-top: 3px;
    color: #4a2030;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-message-bubble--reverse-invasion-receipt .rir-evidence {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(247, 237, 255, 0.78);
    border: 1px solid rgba(192, 113, 255, 0.18);
}

.chat-message-bubble--reverse-invasion-receipt .rir-evidence-app {
    font-weight: 600;
    color: #58208c;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.chat-message-bubble--reverse-invasion-receipt .rir-section-fallback {
    background: rgba(255, 255, 255, 0.78);
    padding: 8px 10px;
    border-radius: 10px;
    color: #3a1c2c;
}

