/* 微信页面样式（阶段 4 第一批拆分） */
#wechat-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
}

#wechat-page.active {
    display: flex;
}

.wechat-header {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    background: rgba(191, 189, 195, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wechat-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wechat-back-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.wechat-header h1 {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.wechat-header-buttons {
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.wechat-header-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.wechat-header-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.wechat-header-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.wechat-add-menu {
    position: absolute;
    top: 60px;
    right: 13px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 100;
    overflow: hidden;
}

.wechat-add-menu.show {
    display: block;
}

.wechat-add-menu-item {
    padding: 12px 24px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.wechat-add-menu-item:hover {
    background-color: #f5f5f5;
}

.wechat-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: rgba(250, 250, 250, 0.65);
}

.wechat-bottom-nav {
    display: flex;
    flex-shrink: 0;
    background: rgba(191, 189, 195, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.wechat-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.wechat-nav-item.active .wechat-nav-text {
    color: #07C160;
}

.wechat-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    width: 32px;
    height: 32px;
}

.wechat-nav-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wechat-nav-text {
    font-size: 12px;
    color: #666;
    transition: color 0.3s ease;
    display: none;
}

.wechat-chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.wechat-chat-item:hover {
    background-color: #f5f5f5;
}

.wechat-chat-item.unread {
    background-color: transparent;
}

.wechat-chat-item.unread .wechat-chat-name {
    font-weight: normal;
    color: inherit;
}

.wechat-chat-unread {
    display: none;
}

.wechat-chat-content {
    flex: 1;
    min-width: 0;
    position: relative;
}

.wechat-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background-color: #07C160;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    margin-right: 12px;
}

.wechat-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.wechat-chat-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.wechat-chat-time {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.wechat-chat-message {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#chat-page {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #f2f2f2;
    position: relative;
}

#chat-page.active {
    display: flex;
    /* 允许顶栏昵称长于中间插图时横向完整露出（不被 .page 的 overflow:hidden 裁掉） */
    overflow-x: visible;
    overflow-y: hidden;
    min-height: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 11px 10px;
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    overflow: visible;
    position: relative;
    z-index: 5;
}

.chat-header .back-btn {
    position: static;
    transform: none;
    margin-right: 11px;
    width: 30px;
    height: 30px;
}

.chat-contact-name-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 心跳监控：昵称叠在插图上；完整显示昵称，可宽于插图/按钮 */
.chat-heartbeat-monitor-hitarea .chat-contact-name-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    z-index: 1;
    pointer-events: none;
    color: #2c2c2c;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.95),
        0 0 3px rgba(255, 255, 255, 0.9),
        0 1px 2px rgba(0, 0, 0, 0.18);
}

.chat-header-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 0;
}

.chat-header-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.chat-back-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chat-header-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chat-header-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.chat-heartbeat-monitor {
    position: relative;
    list-style: none;
    overflow: visible;
}

.chat-heartbeat-monitor--center {
    flex: 1 1 0;
    min-width: 0;
    display: block;
    overflow: visible;
}

.chat-heartbeat-monitor-summary {
    list-style: none;
    cursor: pointer;
    padding: 4px 6px 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.chat-heartbeat-monitor-summary::-webkit-details-marker {
    display: none;
}

.chat-heartbeat-monitor-summary::marker {
    content: none;
}

.chat-heartbeat-monitor-summary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.chat-heartbeat-monitor-hitarea {
    position: relative;
    display: inline-block;
    max-width: none;
    min-width: 0;
    vertical-align: middle;
    line-height: 0;
    transition: transform 0.2s ease;
    overflow: visible;
}

.chat-heartbeat-monitor-graphic {
    height: 32px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
}

.chat-heartbeat-monitor[open] .chat-heartbeat-monitor-hitarea {
    transform: scale(1.04);
}

.chat-heartbeat-monitor-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 120;
    min-width: 200px;
    max-width: min(280px, 85vw);
    box-sizing: border-box;
}

.chat-heartbeat-monitor-inner {
    /* 85% 不透明度 + 12px 背景模糊：磨砂玻璃 */
    background-color: rgba(255, 245, 242, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
    border-left: 3px solid #e74c3c;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    max-height: min(52vh, 380px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-heartbeat-monitor-inner::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.heartbeat-report {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
}

.heartbeat-rate {
    margin-bottom: 8px;
}

.heartbeat-rate-num {
    font-size: 32px;
    font-weight: 700;
    color: #e74c3c;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.heartbeat-rate-unit {
    font-size: 13px;
    color: #999;
    margin-left: 3px;
}

.heartbeat-emotions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.heartbeat-emotion-tag {
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    line-height: 1.5;
}

.heartbeat-thought {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    border-top: 1px solid rgba(231, 76, 60, 0.15);
    padding-top: 8px;
    font-style: italic;
}

.heartbeat-section {
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(231, 76, 60, 0.12);
    font-size: 12px;
    line-height: 1.5;
    color: #444;
    word-break: break-word;
}

.heartbeat-section-label {
    display: block;
    font-weight: 600;
    color: #c0392b;
    margin-bottom: 4px;
    font-size: 12px;
    font-style: normal;
}

.heartbeat-section-body {
    color: #555;
    white-space: pre-wrap;
}

.chat-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 96px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.chat-system-message {
    align-self: center;
    background: rgba(0, 0, 0, 0.05);
    color: #999;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    margin: 8px 0;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.chat-message.other-message {
    justify-content: flex-start;
}

.chat-message.my-message {
    justify-content: flex-end;
}

.phone-wechat-scope .wechat-chat-avatar,
.phone-wechat-scope .chat-message-avatar {
    display: none !important;
}

.phone-wechat-scope .chat-message {
    gap: 0;
}

.phone-wechat-scope .chat-message.my-message .chat-message-content {
    align-items: flex-end;
}

.chat-message-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.chat-message-avatar.transparent-avatar {
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: transparent;
}

/* 群聊成员无头像 URL 时的首字占位（避免误匹配 speakerId 时出现空白圆） */
.chat-message.other-message .chat-message-avatar.chat-message-avatar-letter {
    background: linear-gradient(145deg, #9e9e9e 0%, #bdbdbd 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    border: none;
}

.chat-message.other-message .chat-message-avatar.chat-message-avatar-letter--unknown {
    background: linear-gradient(145deg, #757575 0%, #9e9e9e 100%);
}

.chat-message.my-message .chat-message-avatar {
    background-color: #187498;
}

.chat-message.my-message .chat-message-avatar.transparent-avatar {
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: transparent;
}

.chat-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-message-bubble {
    display: inline-flex;
    position: relative;
    min-width: 30px;
    width: fit-content;
    max-width: 80%;
    font-size: 15px;
    z-index: 1;
    word-wrap: break-word;
    word-break: normal;
    white-space: normal;
    cursor: pointer;
    overflow: hidden;
    padding: 12px 16px;
    box-sizing: border-box;
    line-height: 1.3;
    min-height: 40px;
    align-items: center;
}

.chat-message.other-message .chat-message-bubble {
    border-radius: 9px;
    padding: 12px 16px;
    color: #000000;
    border: 1px solid #ababab;
    background: rgba(235, 235, 235, 1);
    box-shadow: -1px 1px 2px 1px rgba(0, 0, 0, 0);
}

.chat-message.my-message .chat-message-bubble {
    border-radius: 9px 9px 10px 9px;
    padding: 12px 16px;
    color: #000000;
    border: 1px solid #a8a8a8;
    background: rgba(255, 255, 255, 1);
    box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0);
}

.chat-bubble-fallback {
    color: #888;
    font-size: 13px;
    line-height: 1.35;
}

/* 与同页 .chat-content 的 gap(12px) 对齐：一条消息拆成多气泡（文字+表情图）时不再显得过窄 */
.chat-message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    flex: 1 1 0%;
    min-width: 0;
}

.chat-message-timestamp {
    font-size: 11px;
    color: #999;
    margin-top: 0;
    margin-left: 8px;
    white-space: nowrap;
}

.chat-message-name {
    font-size: 12px;
    color: #8a8a8a;
    line-height: 1.1;
    margin-left: 8px;
    margin-top: 2px;
    margin-bottom: -2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.chat-message.my-message .chat-message-name {
    display: none;
}

.chat-message.my-message .chat-message-content {
    align-items: flex-end;
}

.chat-message.my-message .chat-message-timestamp {
    margin-left: 0;
    margin-right: 8px;
}

/* 与 .chat-input-area 同为底栏时，需高于输入条(z-index:3000)，避免被毛玻璃底栏完全挡住看不见引用正文 */
.chat-quote-frame {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 56px;
    z-index: 3100;
    background-color: #f0f0f0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 15px 10px;
    font-size: 14px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    max-height: 33vh;
    overflow: hidden;
    box-sizing: border-box;
}

@media (min-width: 480px) {
    .chat-quote-frame {
        bottom: 60px;
    }
}

.chat-quote-frame.show {
    display: block;
    cursor: pointer;
}

.chat-quote-frame.show .chat-quote-close {
    cursor: pointer;
}

.chat-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chat-quote-name {
    font-weight: 600;
    color: #333;
}

.chat-quote-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-quote-close:hover {
    color: #333;
}

.chat-quote-content {
    color: #444;
    line-height: 1.4;
    word-break: break-word;
    max-height: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-message-quote {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    border-left: 3px solid #07C160;
    cursor: pointer;
}

.chat-message-quote:focus-visible {
    outline: 2px solid rgba(7, 193, 96, 0.45);
    outline-offset: 2px;
}

.chat-message-quote .quote-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.chat-message-quote .quote-content {
    line-height: 1.3;
    word-break: break-word;
}

/* 须高于 .chat-input-area(3000) / 引用条(3100)，否则详情层被挡无法交互 */
#chat-quote-detail-modal.chat-quote-detail-modal,
.chat-quote-detail-modal {
    z-index: 10050;
}

.chat-quote-detail-modal {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.chat-quote-detail-modal.show {
    display: flex !important;
}

.chat-quote-detail-content {
    width: min(420px, 100%);
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
}

.chat-quote-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-quote-detail-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.chat-quote-detail-close {
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #888;
    cursor: pointer;
}

.chat-quote-detail-body {
    padding: 16px 18px 20px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-multiselect-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(240, 238, 235, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    font-size: 13px;
    box-sizing: border-box;
    height: 60px;
    width: 480px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.chat-multiselect-bar.show {
    display: flex;
}

.chat-more-panel {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-more-panel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.chat-more-panel.show {
    display: block;
}

/* 底栏 .chat-input-area 在 style.css 中为 z-index:3000；更多/表情面板原 1000 会被压在下方，此处抬高 */
#chat-page .chat-more-panel,
#chat-page .emoji-panel {
    z-index: 3100;
}

.chat-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 16px;
}

.chat-more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 12px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.chat-more-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.chat-content.more-panel-open,
.chat-content.read-together-panel-open {
    padding-bottom: 280px;
}

.chat-content.dynamic-island-open {
    padding-top: 56px;
}

.chat-more-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: #333;
}

.chat-more-icon svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.chat-more-item:nth-child(2) .chat-more-icon svg {
    width: 22px;
    height: 28px;
}

.chat-more-label {
    font-size: 12px;
    color: #333;
    text-align: center;
}

.chat-settings-modal {
    width: 90%;
    max-width: 400px;
    background: rgba(240, 240, 240, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    overflow: hidden;
}

/* 置于 #chat-page 内：相对聊天页绝对铺满，避免 body 级 fixed 超出 Lego #app 圆角框 */
#chat-settings-modal.modal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2250;
    box-sizing: border-box;
    padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

#chat-settings-modal .modal-content.chat-settings-modal {
    width: min(90%, 400px);
    max-height: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 1;
}

#chat-settings-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px 12px;
    -webkit-overflow-scrolling: touch;
}

#chat-settings-modal .chat-settings-list {
    gap: 10px;
    padding: 12px;
}

#chat-settings-modal .chat-settings-item {
    padding: 12px 14px;
}

#chat-settings-modal .delete-and-exit-btn {
    margin-top: 14px;
    margin-bottom: 8px;
    padding: 14px;
}

.chat-settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.chat-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-settings-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.chat-settings-label {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.chat-settings-arrow {
    font-size: 14px;
    color: #999;
}

.chat-settings-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.chat-settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.chat-settings-item.danger {
    color: #ff3b30;
}

.chat-settings-item.danger .chat-settings-label {
    color: #ff3b30;
}

.chat-avatar-container {
    display: flex;
    align-items: center;
}

.chat-avatar-box {
    width: 60px;
    height: 60px;
    border: 2px dashed #ddd;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-avatar-box:hover {
    border-color: #07C160;
    background-color: rgba(7, 193, 96, 0.05);
}

/* 配合 <label for>：隐藏 file input，依赖标签激活文件选择（比单独 JS click 更稳） */
.chat-avatar-box input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.chat-avatar-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.chat-avatar-hint {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 60px;
    transition: all 0.3s ease;
}

.chat-avatar-box.has-avatar .chat-avatar-hint {
    opacity: 0;
    visibility: hidden;
}

.chat-summary-modal,
.chat-summary-prompt-picker-modal,
.chat-summary-prompt-create-modal {
    z-index: 2290;
}

.chat-summary-modal-content,
.chat-summary-prompt-picker-content,
.chat-summary-prompt-create-content {
    width: 340px;
    max-width: 92%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 36px rgba(0,0,0,0.18);
    overflow: hidden;
}

.chat-summary-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.chat-summary-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #222;
}

.chat-summary-close {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.chat-summary-body {
    padding: 16px;
}

.chat-summary-detect {
    font-size: 13px;
    line-height: 1.45;
    color: #555;
    background: rgba(7,193,96,0.08);
    border: 1px solid rgba(7,193,96,0.16);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.chat-summary-field {
    margin-bottom: 14px;
}

.chat-summary-field:last-child {
    margin-bottom: 0;
}

.chat-summary-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.chat-summary-input {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    background: #fff;
}

.chat-summary-input:focus,
.chat-summary-textarea:focus {
    outline: none;
    border-color: #07C160;
}

.chat-summary-prompt-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-summary-prompt-display {
    cursor: pointer;
}

.chat-summary-prompt-btn {
    flex: 0 0 auto;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: #07C160;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.chat-summary-footer,
.chat-summary-prompt-picker-footer,
.chat-summary-prompt-create-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #eee;
}

.chat-summary-btn {
    flex: 1;
    padding: 12px 10px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

.chat-summary-btn.cancel {
    background: #f0f0f0;
    color: #333;
}

.chat-summary-btn.confirm {
    background: #07C160;
    color: #fff;
}

.chat-summary-btn.confirm:hover {
    background: #06ad56;
}

.chat-summary-prompt-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.chat-summary-prompt-picker-title {
    font-size: 16px;
    font-weight: 800;
    color: #222;
}

.chat-summary-prompt-picker-add {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: #07C160;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.chat-summary-prompt-picker-body {
    padding: 12px 10px;
    max-height: 52vh;
    overflow-y: auto;
}

.chat-summary-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-summary-prompt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid #eee;
    background: #fff;
    cursor: pointer;
}

.chat-summary-prompt-item.active {
    border-color: rgba(7,193,96,0.55);
    box-shadow: 0 6px 18px rgba(7,193,96,0.12);
}

.chat-summary-prompt-name {
    font-size: 14px;
    font-weight: 800;
    color: #333;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-summary-prompt-badge {
    flex-shrink: 0;
    font-size: 12px;
    color: #07C160;
    font-weight: 800;
}

.chat-summary-prompt-empty {
    padding: 18px 8px 8px;
    text-align: center;
    font-size: 13px;
    color: #999;
}

.chat-summary-prompt-create-header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.chat-summary-prompt-create-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #222;
}

.chat-summary-prompt-create-body {
    padding: 16px;
}

.chat-summary-textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
}

.chat-forward-banner {
    font-size: 11px;
    color: #8a8a8a;
    line-height: 1.25;
    margin: 0 8px 2px;
    max-width: 260px;
    word-break: break-all;
}

.chat-message.my-message .chat-forward-banner {
    margin-left: 0;
    margin-right: 8px;
    align-self: flex-end;
    text-align: right;
}

.chat-moments-forward-surface {
    max-width: min(92vw, 280px);
    margin: 2px 0 4px;
    align-self: flex-end;
}

.chat-message.other-message .chat-moments-forward-surface {
    align-self: flex-start;
}

.chat-moments-forward-card {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    text-align: left;
}

.chat-moments-forward-card--err {
    padding: 12px;
    font-size: 13px;
    color: #888;
}

.chat-moments-forward-badge {
    font-size: 11px;
    color: #07c160;
    font-weight: 600;
    padding: 8px 10px 0;
    letter-spacing: 0.02em;
}

.chat-moments-forward-author-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 6px 10px 8px;
    align-items: center;
}

.chat-moments-forward-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: #ddd;
}

.chat-moments-forward-avatar--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    background: #9e9e9e;
}

.chat-moments-forward-author-meta {
    min-width: 0;
    flex: 1;
}

.chat-moments-forward-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    line-height: 1.25;
    word-break: break-all;
}

.chat-moments-forward-author-time {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.chat-moments-forward-text {
    font-size: 14px;
    color: #222;
    line-height: 1.45;
    padding: 0 10px 8px;
    word-break: break-word;
}

.chat-moments-forward-text--trigger {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    display: block;
}

.chat-moments-forward-text-body {
    display: block;
}

.chat-moments-forward-text-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #576b95;
}

.chat-moments-forward-text--trigger.is-expanded .chat-moments-forward-text-hint::after {
    content: "  已展开";
    color: #888;
}

.chat-moments-forward-imgs {
    display: grid;
    gap: 4px;
    padding: 0 10px 8px;
}

.chat-moments-forward-imgs--n1 {
    grid-template-columns: 1fr;
}

.chat-moments-forward-imgs--n2,
.chat-moments-forward-imgs--n4 {
    grid-template-columns: repeat(2, 1fr);
}

.chat-moments-forward-imgs--n3,
.chat-moments-forward-imgs--n5,
.chat-moments-forward-imgs--n6,
.chat-moments-forward-imgs--n7,
.chat-moments-forward-imgs--n8,
.chat-moments-forward-imgs--n9 {
    grid-template-columns: repeat(3, 1fr);
}

.chat-moments-forward-imgs img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background: #e8e8e8;
}

.chat-moments-forward-polaroid-host {
    padding: 0 8px 8px;
}

.chat-moments-forward-polaroid-host .wechat-polaroid-wrap {
    max-width: 100%;
}

.chat-moments-forward-social {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.55);
    padding: 6px 10px 8px;
}

.chat-moments-forward-like-strip {
    font-size: 12px;
    color: #576b95;
    line-height: 1.35;
    margin-bottom: 4px;
}

.chat-moments-forward-like-ico {
    font-size: 11px;
    margin-right: 2px;
}

.chat-moments-forward-comments {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.chat-moments-forward-c-line {
    margin-top: 4px;
    word-break: break-word;
}

.chat-moments-forward-c-author {
    color: #576b95;
    font-weight: 500;
}

.chat-moments-forward-c-reply {
    color: #888;
    font-size: 12px;
}

/* 情侣空间：聊天内邀请/答应卡片（磨砂玻璃 + 荷叶边外框；不复用朋友圈卡） */
.chat-couple-space-surface {
    max-width: min(92vw, 300px);
    margin: 2px 0 4px;
    align-self: flex-end;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.12));
}

.chat-message.other-message .chat-couple-space-surface {
    align-self: flex-start;
}

.chat-couple-space-scallop {
    padding: 10px;
    border-radius: 22px;
    /* 保留荷叶边视觉，但不使用 mask（部分浏览器会把内容整块裁掉导致卡片“消失”） */
    background:
        radial-gradient(circle at 10px 0, rgba(244, 176, 165, 0.88) 10px, transparent 11px) 0 0/20px 12px repeat-x,
        radial-gradient(circle at 10px 100%, rgba(244, 176, 165, 0.88) 10px, transparent 11px) 10px 100%/20px 12px repeat-x,
        linear-gradient(135deg, rgba(244, 176, 165, 0.66), rgba(247, 240, 234, 0.72));
    border: 1px solid rgba(244, 176, 165, 0.72);
}

.chat-couple-space-card {
    border-radius: 18px;
    padding: 12px 12px 10px;
    background: linear-gradient(135deg, rgba(247, 240, 234, 0.85) 0%, rgba(244, 176, 165, 0.42) 120%);
    border: 1px solid rgba(244, 176, 165, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.chat-couple-space-card--err {
    font-size: 13px;
    color: rgba(17, 17, 17, 0.62);
    text-align: center;
    padding: 12px 10px;
}

.chat-couple-space-badge {
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(17, 17, 17, 0.72);
}

.chat-couple-space-sub {
    margin-top: 6px;
    text-align: center;
    font-size: 12px;
    color: rgba(17, 17, 17, 0.55);
    line-height: 1.35;
}

.chat-couple-space-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.chat-couple-space-avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65) center/cover no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(244, 176, 165, 0.35);
    flex: 0 0 auto;
}

.chat-couple-space-avatar--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(244, 176, 165, 0.85);
}

.chat-couple-space-connector {
    width: 74px;
    height: 34px;
    flex: 0 0 auto;
    opacity: 0.95;
}

.chat-couple-space-names {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(17, 17, 17, 0.62);
}

.chat-couple-space-name {
    max-width: 42%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-couple-space-dot {
    opacity: 0.35;
}

.chat-dynamic-island {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: none;
}

.chat-dynamic-island.show {
    display: block;
}

.dynamic-island-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 10px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    min-width: 180px;
    max-width: 260px;
}

.dynamic-island-cover {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(145deg, #444, #333);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dynamic-island-placeholder {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
}

.dynamic-island-cover.has-cover {
    background-size: cover;
    background-position: center;
}

.dynamic-island-cover.has-cover .dynamic-island-placeholder {
    display: none;
}

.dynamic-island-info {
    flex: 1;
    min-width: 0;
}

.dynamic-island-track {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dynamic-island-artist {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dynamic-island-play {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.dynamic-island-play:hover {
    background: rgba(255, 255, 255, 0.35);
}

.dynamic-island-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    line-height: 1;
}

.dynamic-island-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.chat-read-together-panel {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    max-height: 280px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-read-together-panel.show {
    display: flex;
}

.chat-message-bubble:has(.wechat-polaroid-wrap),
.chat-message-bubble:has(.art-vibe) {
    display: block !important;
    flex-shrink: 0;
    width: fit-content;
    max-width: min(280px, calc(100% - 16px));
    min-width: min(260px, calc(100% - 20px));
    overflow: visible;
    box-sizing: border-box;
}

.chat-message-bubble.chat-message-bubble--polaroid-html {
    display: block !important;
    flex-shrink: 0;
    width: fit-content;
    max-width: min(280px, calc(100% - 16px));
    min-width: min(260px, calc(100% - 20px));
    overflow: visible;
    box-sizing: border-box;
}

.chat-message.other-message .chat-message-bubble.chat-message-bubble--polaroid-html,
.chat-message.my-message .chat-message-bubble.chat-message-bubble--polaroid-html,
.chat-message.other-message .chat-message-bubble:has(.wechat-polaroid-wrap),
.chat-message.my-message .chat-message-bubble:has(.wechat-polaroid-wrap) {
    padding: 6px 10px !important;
}

.wechat-me-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #f2f2f2;
    position: relative;
}

.wechat-me-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: rgba(191, 189, 195, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wechat-me-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.wechat-me-header.hidden,
.wechat-me-profile.hidden,
.wechat-me-functions.hidden {
    display: none !important;
}

.wechat-me-profile {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    padding: 30px 20px;
    margin-bottom: 10px;
    cursor: pointer;
}

.wechat-me-profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.wechat-me-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
}

.wechat-me-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wechat-me-avatar-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f0f0f2;
    border-radius: 50%;
}

.wechat-me-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wechat-me-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
}

.wechat-me-id {
    font-size: 14px;
    color: #999;
}

.wechat-me-functions {
    background-color: #fff;
}

.wechat-me-function-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.wechat-me-function-icon {
    font-size: 20px;
    margin-right: 15px;
    width: 34px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wechat-me-function-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.wechat-settings-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    background: #f2f2f2;
    z-index: 100;
}

.wechat-settings-page.show {
    display: flex;
}

.wechat-settings-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.wechat-settings-back {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.wechat-settings-title {
    flex: 1;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

.wechat-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 24px;
}

.wechat-settings-intro {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    margin: 0 0 14px;
}

.wechat-settings-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wechat-settings-row {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.wechat-settings-row:last-child {
    border-bottom: none;
}

.wechat-settings-row--bubble {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.wechat-settings-row--bubble .wechat-settings-label {
    margin-bottom: 4px;
}

.wechat-settings-row--bubble .wechat-settings-desc {
    margin-bottom: 10px;
}

.wechat-settings-row--bubble .wechat-settings-desc code {
    font-size: 11px;
    background: #f3f3f3;
    padding: 1px 4px;
    border-radius: 4px;
}

.wechat-settings-bubble-preview-block {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e8e8e8;
}

.wechat-settings-row--bubble .wechat-bubble-css-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 160px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    border: 1px solid #ddd;
    border-radius: 10px;
    resize: vertical;
    background: #fafafa;
    color: #222;
    margin-bottom: 8px;
}

.wechat-settings-row--bubble .wechat-bubble-css-textarea:focus {
    outline: none;
    border-color: #07c160;
    background: #fff;
}

.wechat-settings-label {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 6px;
}

.wechat-settings-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.45;
    margin-bottom: 8px;
}

.wechat-settings-status {
    font-size: 12px;
    color: #07c160;
}

.wechat-settings-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.wechat-settings-file {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.wechat-settings-btn {
    padding: 8px 14px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background: #07c160;
    color: #fff;
    cursor: pointer;
}

.wechat-settings-btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.wechat-settings-btn:active {
    opacity: 0.88;
}

.wechat-settings-preview-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e8e8e8;
}

.wechat-settings-preview-caption {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
}

.wechat-settings-bg-thumb {
    display: block;
    max-width: 100%;
    max-height: 132px;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wechat-settings-bubble-preview-host {
    background: #ededed;
    border-radius: 10px;
    padding: 10px 8px 12px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.wechat-settings-bubble-preview-row {
    margin-bottom: 8px;
}

.wechat-settings-bubble-preview-row:last-child {
    margin-bottom: 0;
}

.wechat-settings-bubble-preview-host .chat-message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-shrink: 0;
}

.wechat-settings-bubble-preview-host .chat-message-bubble {
    font-size: 14px;
    pointer-events: none;
    cursor: default;
}

.wechat-settings-font-sample {
    font-size: 15px;
    line-height: 1.65;
    padding: 12px 14px;
    background: linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    color: #222;
}

html.wechat-global-font-on .wechat-settings-font-sample {
    font-family: 'WechatUserGlobalFont', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.wechat-settings-text-input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: #111;
    font-size: 14px;
    outline: none;
}

.wechat-settings-text-input:focus {
    border-color: rgba(7, 193, 96, 0.55);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

html.wechat-global-bg-on .wechat-chat-list {
    background: rgba(250, 250, 250, 0.5) !important;
}

html.wechat-global-bg-on #wechat-me-page .wechat-me-content,
html.wechat-global-bg-on #wechat-discover-page .discover-content {
    background: transparent !important;
}

/* ── 更多功能 · 语音消息 / 语音电话（Lego WECHAT VOICE BLOCK） ─────────── */

.voice-feature-modal-inner {
    max-width: 320px;
    padding: 18px 16px 14px;
    border-radius: 16px;
}
.voice-feature-modal-head {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: #111;
}
.voice-feature-modal-hint {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin: 0 0 16px;
    line-height: 1.45;
}
.voice-feature-modal-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.voice-feature-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #fafafa 0%, #f3f5f8 100%);
    text-align: left;
    cursor: pointer;
}
.voice-feature-choice-btn:active {
    opacity: 0.92;
}
.voice-feature-choice-title {
    font-size: 16px;
    font-weight: 600;
    color: #111;
}
.voice-feature-choice-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}
.voice-feature-choice-btn--call {
    background: linear-gradient(135deg, #2d1f3f 0%, #4b2f6b 55%, #7b4bb8 100%);
    border-color: transparent;
}
.voice-feature-choice-btn--call .voice-feature-choice-title,
.voice-feature-choice-btn--call .voice-feature-choice-desc {
    color: #fff;
    opacity: 0.95;
}
.voice-feature-modal-cancel {
    margin-top: 14px;
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 15px;
}
.voice-msg-compose-inner {
    max-width: 340px;
    padding: 18px 16px;
    border-radius: 14px;
}
.voice-msg-compose-head {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}
.voice-msg-compose-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 15px;
    resize: vertical;
    min-height: 120px;
}
.voice-msg-compose-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}
.voice-msg-compose-cancel {
    padding: 8px 16px;
    border: none;
    background: #eee;
    border-radius: 8px;
}
.voice-msg-compose-ok {
    padding: 8px 18px;
    border: none;
    background: #07c160;
    color: #fff;
    border-radius: 8px;
}

/* Minimax TTS：好友气泡下的可点击播放（满足移动端自动播放策略） */
.chat-minimax-tts-row {
    margin-top: 6px;
    display: flex;
    justify-content: flex-start;
}
.chat-minimax-tts-play-btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 16px;
    border: 1px solid rgba(7, 193, 96, 0.45);
    background: rgba(7, 193, 96, 0.12);
    color: #06ae56;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.chat-minimax-tts-play-btn:active {
    opacity: 0.85;
}

/* ── INS 风格仿语音条（点击展开正文） ─────────────────────────────── */
.chat-message-bubble--voice-note-fake {
    padding: 0;
    background: transparent !important;
    max-width: 88%;
}
.my-message .chat-message-bubble--voice-note-fake {
    margin-left: auto;
}
.wechat-voice-note-fake-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 200px;
}
/* RAL Design 语义：渐变起止为 RAL 180 80 10（≈Light teal）↔ RAL 240 60 15（≈Architecture blue）；官方色号近似 HEX 见注释 */
.wechat-voice-note-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px 10px 10px;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    text-align: left;
    /* RAL 180 80 10 → #B1CCC5 ， RAL 240 60 15 → #7195A6 */
    background: linear-gradient(118deg, #b1ccc5 0%, #7195a6 100%);
    color: #0f172a;
    box-shadow: 0 4px 16px rgba(113, 149, 166, 0.38);
}
.my-message .wechat-voice-note-toggle {
    background: linear-gradient(118deg, #b1ccc5 0%, #7195a6 100%);
}
.other-message .wechat-voice-note-toggle {
    background: linear-gradient(118deg, #7195a6 0%, #b1ccc5 100%);
    box-shadow: 0 4px 16px rgba(80, 110, 128, 0.35);
}
.wechat-voice-note-mic {
    display: flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
    flex-shrink: 0;
    color: #0f172a;
}
.wechat-voice-note-mic svg {
    width: 20px;
    height: 20px;
}
.wechat-voice-note-wave {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    min-height: 22px;
    padding: 0 4px;
}
.wechat-voice-note-wave-bar {
    width: 3px;
    border-radius: 2px;
    background: rgba(15, 23, 42, 0.5);
    align-self: center;
}
.wechat-voice-note-dur {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    opacity: 0.92;
    flex-shrink: 0;
    font-weight: 600;
}
.wechat-voice-note-hint {
    display: none;
    font-size: 10px;
    opacity: 0.8;
}
@media (max-width: 380px) {
    .wechat-voice-note-hint {
        display: none !important;
    }
}
.wechat-voice-note-expanded {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 14px;
    line-height: 1.5;
    color: #222;
}
.my-message .wechat-voice-note-expanded {
    background: rgba(255, 255, 255, 0.35);
    color: #111;
}
.other-message .wechat-voice-note-expanded {
    background: rgba(255, 255, 255, 0.94);
}
.wechat-voice-note-expanded[hidden] {
    display: none !important;
}

/* ── 语音电话全屏层 ───────────────────────────────────────────────── */
.voice-call-overlay {
    position: absolute;
    inset: 0;
    z-index: 10100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 20%, rgba(60, 40, 90, 0.5) 0%, rgba(8, 6, 18, 0.96) 55%, #020006 100%);
    padding: 10px;
    box-sizing: border-box;
}
.voice-call-shell {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 56%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.voice-call-overlay .voice-call-layer {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}
.voice-call-overlay--ringing .voice-call-layer--ringing {
    display: flex;
}
.voice-call-overlay--rejected .voice-call-layer--rejected {
    display: flex;
}
.voice-call-overlay--connected .voice-call-layer--connected {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* 呼叫中 */
.voice-call-layer--ringing {
    padding: 24px 16px 32px;
    position: relative;
}
.voice-call-ringing-pulse {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.25);
    animation: voiceRingPulse 1.8s ease-out infinite;
    pointer-events: none;
}
@keyframes voiceRingPulse {
    0% {
        transform: scale(0.7);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}
.voice-call-peer-avatar--lg {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: #333 center/cover no-repeat;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 1;
    border: 3px solid rgba(255, 255, 255, 0.15);
}
.voice-call-peer-avatar--lg.voice-call-avatar--empty {
    background: linear-gradient(145deg, #555, #222);
}
.voice-call-peer-name-lg {
    margin-top: 18px;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    position: relative;
    z-index: 1;
}
.voice-call-status-lg {
    margin-top: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
}
.voice-call-btn-hangup {
    margin-top: 36px;
    padding: 12px 36px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 59, 48, 0.95);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

/* 拒接 */
.voice-call-layer--rejected {
    text-align: center;
    color: #fff;
    padding: 20px;
}
.voice-call-rejected-icon {
    font-size: 44px;
    opacity: 0.6;
    margin-bottom: 8px;
}
.voice-call-rejected-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}
.voice-call-rejected-reason {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.85;
    margin: 0 0 24px;
}
.voice-call-btn-plain {
    padding: 10px 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 15px;
}

/* 接通：主区域 */
.voice-call-layer--connected {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    min-height: 420px;
    max-height: 88vh;
    background: #0b0b12;
}
.voice-call-connected-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(88, 28, 135, 0.5) 0%, rgba(15, 23, 42, 0.95) 48%, #020617 100%);
    pointer-events: none;
}
.voice-call-connected-top {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px;
    z-index: 2;
    flex-shrink: 0;
}
.voice-call-peer-avatar--sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #444 center/cover no-repeat;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.voice-call-peer-avatar--sm.voice-call-avatar--empty {
    background: linear-gradient(145deg, #666, #333);
}
.voice-call-top-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.voice-call-peer-name-sm {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
}
.voice-call-timer-dim {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    font-variant-numeric: tabular-nums;
}
.voice-call-connect-scroll {
    position: relative;
    flex: 1;
    min-height: 140px;
    max-height: 36vh;
    overflow-y: auto;
    padding: 8px 12px;
    z-index: 2;
}
.voice-call-msg-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.voice-call-msg {
    display: flex;
}
.voice-call-msg--me {
    justify-content: flex-end;
}
.voice-call-msg--them {
    justify-content: flex-start;
}
.voice-call-msg--sys {
    justify-content: center;
}
.voice-call-msg-bubble {
    max-width: 88%;
    padding: 8px 11px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}
.voice-call-msg--me .voice-call-msg-bubble {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
}
.voice-call-msg--them .voice-call-msg-bubble {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
}
.voice-call-msg--sys .voice-call-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}
.voice-call-msg-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    padding: 20px 8px;
}
.voice-call-connect-footer {
    position: relative;
    z-index: 2;
    padding: 8px 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}
.voice-call-composer {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.voice-call-input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    padding: 8px 14px;
    font-size: 14px;
}
.voice-call-send-mini {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(168, 85, 247, 0.9);
    color: #fff;
    font-size: 14px;
}
.voice-call-ctl-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
}
.voice-call-ctl-btn {
    flex: 1 1 auto;
    min-width: 52px;
    padding: 8px 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12px;
}
.voice-call-ctl-btn--danger {
    background: rgba(220, 38, 38, 0.85);
    border-color: transparent;
}
.voice-call-ctl-btn.voice-call-ctl--active {
    background: rgba(234, 179, 8, 0.35);
    border-color: rgba(250, 204, 21, 0.6);
}
.voice-call-vol-label {
    display: flex;
    flex: 2 1 120px;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}
.voice-call-vol-label input[type='range'] {
    flex: 1;
}

/* 缩小条（仅接通 + minimized） */
.voice-call-compact-bar {
    display: none;
    position: relative;
    z-index: 3;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.voice-call-compact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #444 center/cover no-repeat;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.18);
}
.voice-call-compact-avatar.voice-call-avatar--empty {
    background: linear-gradient(145deg, #666, #333);
}
.voice-call-compact-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
#voice-call-compact-name {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}
#voice-call-compact-timer {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.voice-call-bar-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
}
.voice-call-bar-btn-danger {
    background: rgba(220, 38, 38, 0.85);
    border-color: transparent;
}

.voice-call-connected-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
}

.voice-call-overlay.voice-call-overlay--minimized {
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 10px;
    background: rgba(0, 0, 0, 0.35);
}
.voice-call-overlay.voice-call-overlay--minimized .voice-call-shell {
    min-height: 0;
    max-width: 380px;
}
.voice-call-overlay.voice-call-overlay--minimized .voice-call-layer--connected {
    min-height: 0;
    max-height: none;
    width: 100%;
}
.voice-call-overlay.voice-call-overlay--minimized .voice-call-compact-bar {
    display: flex;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.voice-call-overlay.voice-call-overlay--minimized #voice-call-connected-main {
    display: none !important;
}

/* 主聊天：语音通话结束卡片（折叠通话内消息） */
.chat-system-message--voice-call-bundle-wrap.chat-system-message {
    background: transparent;
    padding: 0;
    max-width: min(96%, 340px);
}
.chat-voice-call-bundle {
    background: linear-gradient(145deg, rgba(7, 193, 96, 0.12), rgba(0, 0, 0, 0.04));
    border: 1px solid rgba(7, 193, 96, 0.25);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}
.chat-voice-call-bundle-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    width: 100%;
    border: none;
    background: transparent;
    color: #333;
    font-size: 13px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.chat-voice-call-bundle-icon {
    font-size: 16px;
    line-height: 1;
}
.chat-voice-call-bundle-title {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    color: #1a1a1a;
}
.chat-voice-call-bundle-dur {
    font-size: 12px;
    color: #666;
    font-variant-numeric: tabular-nums;
}
.chat-voice-call-bundle-hint {
    width: 100%;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.chat-voice-call-bundle-expanded {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 8px 10px 10px;
    background: rgba(255, 255, 255, 0.55);
    max-height: 240px;
    overflow-y: auto;
}
.chat-voice-call-inline {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.45;
    /* 避免昵称列与正文列在空间不足时叠在一起 */
}
.chat-voice-call-inline:last-child {
    margin-bottom: 0;
}
.chat-voice-call-inline-label {
    flex: 0 1 auto;
    align-self: flex-start;
    max-width: min(42%, 10rem);
    min-width: 3em;
    padding-right: 4px;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.chat-voice-call-inline-text {
    flex: 1 1 0;
    min-width: 0;
    color: #333;
    word-break: break-word;
}
.chat-voice-call-inline--me .chat-voice-call-inline-label {
    color: #576b95;
}
.chat-voice-call-inline--them .chat-voice-call-inline-label {
    color: #07c160;
}
.chat-voice-call-inline-empty {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 8px 0;
}

/* ==================== 思念距离功能样式 ==================== */

/* 思念距离页面容器 */
.missing-distance-page {
    /* 贴合情侣空间层（#app 内），勿用 fixed+100% 视口，否则宽高超出了 Lego 小手机屏幕区域 */
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #FFE5F0 0%, #E8D5F2 50%, #D5E8F7 100%);
    z-index: 150;
    display: none;
    flex-direction: column;
    /* 与 .couple-diary-page / .couple-bill-page 一致，供 .couple-diary-toolbar 与 body 顶距使用 */
    --couple-top-gap: calc(12px + env(safe-area-inset-top, 0px));
    --couple-toolbar-slot: 48px;
}

.missing-distance-page.show {
    display: flex;
}

.missing-distance-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 顶栏 absolute，需下移内容区，避免「TA的位置」等与标题同一行重叠 */
    padding-top: calc(var(--couple-top-gap) + var(--couple-toolbar-slot) + 8px);
    box-sizing: border-box;
}

/* 顶部功能栏 */
.missing-distance-toolbar {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 182, 193, 0.3);
    flex-wrap: wrap;
}

.missing-distance-toolbar-btn {
    flex: 1;
    min-width: 70px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 107, 157, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 240, 245, 0.95));
    color: #FF6B9D;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.missing-distance-toolbar-btn:hover {
    background: linear-gradient(135deg, rgba(255, 240, 245, 1), rgba(255, 230, 240, 1));
    border-color: rgba(255, 107, 157, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.2);
}

.missing-distance-toolbar-btn--primary {
    background: linear-gradient(135deg, #FF6B9D, #FF8FB3);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

.missing-distance-toolbar-btn--primary:hover {
    background: linear-gradient(135deg, #FF5A8C, #FF7EA2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

/* 地图容器 */
.missing-distance-map-container {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    margin: 12px 16px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.missing-distance-map-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 距离结果显示 */
.missing-distance-result {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10;
    max-width: 90%;
    text-align: center;
}

.missing-distance-result-placeholder {
    color: #999;
    font-size: 13px;
}

.missing-distance-result-item {
    color: #FF6B9D;
    font-size: 14px;
    font-weight: 600;
    margin: 4px 0;
    line-height: 1.5;
}

/* 聊天消息区域 */
.missing-distance-chat-messages {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60%;
    overflow-y: auto;
    box-sizing: border-box;
    /* 紧贴地图层（即小手机内屏上的白卡片）左右内缘：Char 靠左、User 靠右，仅留最小防裁切间隙 */
    padding: 14px 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.missing-distance-chat-messages::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    background: transparent;
}

.missing-distance-chat-messages::-webkit-scrollbar-thumb {
    background: transparent;
}

.missing-distance-chat-bubble {
    max-width: min(88%, calc(100% - 12px));
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: bubbleFadeIn 0.3s ease;
    position: relative;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

@keyframes bubbleFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.missing-distance-chat-bubble.is-user {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
    background: linear-gradient(135deg, #6B9DFF, #8FB3FF);
    color: white;
    border-bottom-right-radius: 4px;
}

.missing-distance-chat-bubble.is-friend {
    align-self: flex-start;
    margin-right: auto;
    margin-left: 0;
    background: linear-gradient(135deg, #FFB6C1, #FFC8D3);
    color: #333;
    border-bottom-left-radius: 4px;
}

.missing-distance-chat-bubble.selected {
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.65), 0 6px 18px rgba(7, 193, 96, 0.16);
}

.missing-distance-chat-selector {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(7, 193, 96, 0.75);
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%);
    box-sizing: border-box;
}

.missing-distance-chat-bubble.is-user .missing-distance-chat-selector {
    left: -30px;
}

.missing-distance-chat-bubble.is-friend .missing-distance-chat-selector {
    right: -30px;
}

.missing-distance-chat-bubble.selected .missing-distance-chat-selector {
    background: #07C160;
    border-color: #07C160;
}

.missing-distance-chat-bubble.selected .missing-distance-chat-selector::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.missing-distance-chat-quote {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 7px;
    padding: 7px 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.32);
    border-left: 3px solid rgba(255, 255, 255, 0.72);
    color: inherit;
    cursor: pointer;
}

.missing-distance-chat-bubble.is-friend .missing-distance-chat-quote {
    background: rgba(255, 255, 255, 0.52);
    border-left-color: rgba(255, 107, 157, 0.55);
}

.missing-distance-chat-quote-name {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.9;
}

.missing-distance-chat-quote-text {
    font-size: 12px;
    line-height: 1.35;
    opacity: 0.82;
    word-break: break-word;
}

.missing-distance-action-menu {
    position: absolute;
    width: 292px;
    min-height: 64px;
    display: none;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(240, 238, 235, 0.68);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(80, 41, 70, 0.18);
    z-index: 90;
    box-sizing: border-box;
}

.missing-distance-action-menu.show {
    display: flex;
}

.missing-distance-action-item {
    width: 68px;
    min-width: 0;
    height: 52px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #424242;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 12px;
    cursor: pointer;
}

.missing-distance-action-item:hover,
.missing-distance-action-item:active {
    background: rgba(255, 255, 255, 0.36);
}

.missing-distance-action-icon {
    font-size: 20px;
    line-height: 1;
}

.missing-distance-quote-frame {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 75;
    display: none;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 182, 193, 0.42);
    box-shadow: 0 -4px 18px rgba(80, 41, 70, 0.12);
    box-sizing: border-box;
}

.missing-distance-quote-frame.show {
    display: block;
}

.missing-distance-quote-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.missing-distance-quote-name {
    font-size: 12px;
    font-weight: 700;
    color: #FF6B9D;
}

.missing-distance-quote-close {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 107, 157, 0.1);
    color: #FF6B9D;
    font-size: 16px;
    line-height: 22px;
    cursor: pointer;
}

.missing-distance-quote-content {
    color: #555;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.missing-distance-multiselect-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    min-height: 64px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(255, 182, 193, 0.34);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 16px rgba(80, 41, 70, 0.12);
    box-sizing: border-box;
}

.missing-distance-multiselect-bar.show {
    display: flex;
}

.missing-distance-page.is-map-multiselect .missing-distance-chat-bar {
    display: none;
}

.missing-distance-selected-count {
    flex: 1;
    min-width: 0;
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.missing-distance-multiselect-actions {
    display: flex;
    gap: 6px;
}

.missing-distance-mini-btn {
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(255, 107, 157, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #FF6B9D;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.missing-distance-mini-btn.danger {
    border-color: rgba(255, 90, 100, 0.28);
    color: #ff5a64;
}

.missing-distance-confirm-dialog .missing-distance-dialog-panel {
    max-width: 320px;
}

.missing-distance-confirm-title {
    color: #FF6B9D;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}

.missing-distance-confirm-text {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.missing-distance-edit-input {
    width: 100%;
    min-height: 128px;
    padding: 12px;
    border: 1px solid rgba(255, 182, 193, 0.45);
    border-radius: 12px;
    box-sizing: border-box;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.missing-distance-edit-input:focus {
    border-color: #FF6B9D;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.12);
}

.missing-distance-quote-detail-name {
    color: #FF6B9D;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.missing-distance-quote-detail-content {
    color: #333;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 底部聊天输入栏 */
.missing-distance-chat-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 182, 193, 0.3);
}

.missing-distance-chat-action-btn {
    padding: 8px 12px;
    border: 1px solid rgba(255, 107, 157, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 240, 245, 0.95));
    color: #FF6B9D;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.missing-distance-chat-action-btn:hover {
    background: linear-gradient(135deg, rgba(255, 240, 245, 1), rgba(255, 230, 240, 1));
    border-color: rgba(255, 107, 157, 0.5);
}

.missing-distance-chat-action-btn:disabled {
    opacity: 0.88;
    cursor: wait;
    pointer-events: none;
}

.missing-distance-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(255, 182, 193, 0.4);
    border-radius: 20px;
    font-size: 14px;
    background: white;
    outline: none;
    transition: all 0.3s ease;
}

.missing-distance-chat-input:focus {
    border-color: #FF6B9D;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.missing-distance-chat-send-btn {
    padding: 10px 20px;
    border: none;
    background: linear-gradient(135deg, #FF6B9D, #FF8FB3);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.missing-distance-chat-send-btn:hover {
    background: linear-gradient(135deg, #FF5A8C, #FF7EA2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

/* 对话框样式（与页面同夹在情侣空间容器内） */
.missing-distance-dialog {
    position: absolute;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.missing-distance-dialog.show {
    display: flex;
}

.missing-distance-dialog-scrim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.missing-distance-dialog-panel {
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: dialogSlideIn 0.3s ease;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.missing-distance-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 182, 193, 0.3);
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.5), rgba(232, 213, 242, 0.5));
    border-radius: 20px 20px 0 0;
}

.missing-distance-dialog-head span {
    font-size: 16px;
    font-weight: 600;
    color: #FF6B9D;
}

.missing-distance-dialog-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 107, 157, 0.1);
    color: #FF6B9D;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.missing-distance-dialog-close:hover {
    background: rgba(255, 107, 157, 0.2);
    transform: rotate(90deg);
}

.missing-distance-dialog-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.missing-distance-form-group {
    margin-bottom: 16px;
}

.missing-distance-form-group:last-child {
    margin-bottom: 0;
}

.missing-distance-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.missing-distance-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 182, 193, 0.4);
    border-radius: 12px;
    font-size: 14px;
    background: white;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.missing-distance-input:focus {
    border-color: #FF6B9D;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.missing-distance-dialog-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 182, 193, 0.3);
}

.missing-distance-dialog-btn {
    flex: 1;
    padding: 10px 20px;
    border: 1px solid rgba(255, 107, 157, 0.3);
    background: white;
    color: #FF6B9D;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.missing-distance-dialog-btn:hover {
    background: rgba(255, 240, 245, 0.5);
    border-color: rgba(255, 107, 157, 0.5);
}

.missing-distance-dialog-btn--primary {
    background: linear-gradient(135deg, #FF6B9D, #FF8FB3);
    color: white;
    border-color: transparent;
}

.missing-distance-dialog-btn--primary:hover {
    background: linear-gradient(135deg, #FF5A8C, #FF7EA2);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.missing-distance-summary-content {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .missing-distance-toolbar {
        gap: 6px;
        padding: 10px 12px;
    }

    .missing-distance-toolbar-btn {
        min-width: 60px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .missing-distance-map-container {
        margin: 10px 12px;
    }

    .missing-distance-chat-messages {
        padding-left: 8px;
        padding-right: 8px;
    }

    .missing-distance-chat-bubble {
        max-width: min(90%, calc(100% - 12px));
        font-size: 13px;
    }
}
