* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* 避免移动端 100vh 包含地址栏导致溢出 */
    height: 100%;
    height: -webkit-fill-available;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #333;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    min-height: 100%;
    min-height: 100dvh; /* 动态视口，排除移动端浏览器 UI */
    min-height: -webkit-fill-available;
}

/* 背景气泡效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.2) 0%, transparent 40%),
        radial-gradient(circle at 40% 70%, rgba(255,255,255,0.25) 0%, transparent 45%),
        radial-gradient(circle at 70% 80%, rgba(255,255,255,0.15) 0%, transparent 35%),
        radial-gradient(circle at 10% 80%, rgba(255,255,255,0.2) 0%, transparent 40%);
    z-index: 0;
    pointer-events: none;
}

#app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    /* 优先贴合 visualViewport（--lego-vv-h 由 index.html 内联脚本写入），减少国产机底栏/导航条裁切 */
    min-height: min(100vh, 100dvh, var(--lego-vv-h, 100dvh));
    max-height: min(100vh, 100dvh, var(--lego-vv-h, 100dvh));
    height: 100%;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    /* 主界面默认使用系统中文黑体，避免仅继承 body 的西文栈时中文缺字形、□ 或乱码 */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
    /* 适配刘海屏安全区域 */
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* 真机竖屏：贴边显示，避免「手机框」在窄屏上再套一层外边距导致可用高度不足 */
@media (max-width: 480px) {
    #app {
        border-radius: 0;
        box-shadow: none;
    }
}

/* 响应式设置 */
@media (min-width: 481px) {
    #app {
        border-radius: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
        min-height: calc(var(--lego-vv-h, 100dvh) - 40px);
        max-height: calc(var(--lego-vv-h, 100dvh) - 40px);
    }
}

/* 网页模式下的适配 */
@media (min-width: 768px) {
    body {
        background-color: #e0e0e0;
    }
    
    #app {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
}

/* 小屏手机适配（宽度 <= 375 或 高度 <= 700） */
@media (max-width: 375px), (max-height: 700px) {
    .main-card {
        margin: 12px 12px 14px;
    }
    
    .card-content {
        padding: 6px 16px;
    }
    
    .avatar-section {
        margin-bottom: 12px;
        margin-top: 12px;
    }
    
    .avatar-frame {
        width: 80px;
        height: 80px;
    }
    
    .card-meta-below-avatar {
        max-width: 260px;
        gap: 10px;
        padding-bottom: 8px;
    }
    
    .decorative-icons {
        gap: 5px 8px;
    }
    
    .decorative-icon {
        font-size: 14px;
        width: 1.8em;
        height: 1.8em;
    }
    
    .card-signature p {
        font-size: 14px;
    }
    
    .card-location span {
        font-size: 12px;
    }
    
    .home-content {
        padding: 14px 12px 90px;
        gap: 14px;
    }
    
    .date-clock {
        width: 130px;
        height: 130px;
    }
    
    .clock-face {
        width: 90px;
        height: 90px;
    }
    
    .clock-number {
        font-size: 14px;
    }
    
    .clock-day {
        font-size: 14px;
        margin-top: 8px;
    }
    
    .quick-functions {
        width: 130px;
        gap: 10px;
    }
    
    .function-item {
        padding: 6px;
    }
    
    .function-icon {
        width: 34px;
        height: 34px;
    }
    
    .function-icon img {
        width: 100%;
        height: 100%;
    }
    
    .function-name {
        font-size: 11px;
    }
    
    .bottom-nav {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        padding: 6px 8px;
    }
    
    .nav-icon {
        width: 36px;
        height: 36px;
    }
    
    .nav-name {
        font-size: 10px;
    }
}

/* 超小屏适配（如 iPhone SE 320x568） */
@media (max-width: 360px), (max-height: 600px) {
    .main-card {
        margin: 10px 10px 12px;
    }
    
    .avatar-frame {
        width: 70px;
        height: 70px;
    }
    
    .home-content {
        padding: 10px 10px 85px;
        gap: 10px;
    }
    
    .date-clock {
        width: 110px;
        height: 110px;
    }
    
    .clock-face {
        width: 75px;
        height: 75px;
    }
    
    .clock-number {
        font-size: 12px;
    }
    
    .quick-functions {
        width: 110px;
        gap: 8px;
    }
    
    .function-icon {
        width: 30px;
        height: 30px;
    }
    
    .function-name {
        font-size: 10px;
    }
}

.page {
    display: none;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.page.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* 主界面全屏背景层（仅首页，由主题「主界面背景」控制） */
#home-screen {
    position: relative;
}

.friend-darkweb-shell {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(180deg, #eef3f8 0%, #dfe7f2 100%);
    overflow: hidden; /* 侧栏在壳层内平移，避免裁切异常；纵向滚动在 #friend-darkweb-feed 内 */
    box-sizing: border-box;
    min-width: 0;
}

.friend-darkweb-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    position: relative;
    z-index: 9; /* 盖在轻遮罩之上，档案/刷新 始终可点 */
}

.friend-darkweb-tabs {
    flex: 1;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.friend-darkweb-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.friend-darkweb-topbar-title {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #102033;
}

.friend-darkweb-shell-hub {
    min-height: 0;
    /* 底部分区条（风向/深海/清扫）高度约 48～56px + 上内边距，侧栏 bottom 在此壳内要整体抬高，避免被 z-index:9 的底栏挡住 */
    --friend-darkweb-bottom-nav-stack: 68px;
}

.friend-darkweb-shell-hub .friend-darkweb-content-wrap {
    flex: 1;
    min-height: 120px;
}

.friend-darkweb-content-wrap-grow {
    flex: 1;
    min-height: 0;
}

.friend-darkweb-section-grid {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 4px;
    position: relative;
    z-index: 9; /* 盖在轻遮罩之上，风向/深海/清扫 可点 */
}

.friend-darkweb-section-entry {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 14px;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #1e2e46, #34557b);
    color: #eef7ff;
    cursor: pointer;
}

.friend-darkweb-detail-bar-spacer {
    width: 72px;
    flex-shrink: 0;
}

.friend-darkweb-tab,
.friend-darkweb-sidebar-toggle,
.friend-darkweb-mini-btn,
.friend-darkweb-sidebar-link {
    border: none;
    border-radius: 12px;
    background: rgba(16, 19, 24, 0.08);
    color: #102033;
    padding: 8px 12px;
    font-size: 13px;
}

.friend-darkweb-mini-btn.friend-darkweb-refresh--busy,
button.friend-darkweb-refresh--busy {
    min-width: 3.1em;
    min-height: 1.1em;
    text-align: center;
}

.friend-darkweb-refresh-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 1.1em;
    vertical-align: middle;
}

.friend-darkweb-refresh-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    animation: friend-darkweb-refresh-dot-flow 0.9s ease-in-out infinite;
}

.friend-darkweb-refresh-dot:nth-child(1) {
    animation-delay: 0ms;
}
.friend-darkweb-refresh-dot:nth-child(2) {
    animation-delay: 120ms;
}
.friend-darkweb-refresh-dot:nth-child(3) {
    animation-delay: 240ms;
}

.friend-darkweb-mini-btn-primary.friend-darkweb-refresh--busy {
    color: #eef7ff;
}

.friend-darkweb-refresh--busy .friend-darkweb-refresh-dot {
    color: currentColor;
}

@keyframes friend-darkweb-refresh-dot-flow {
    0%,
    100% {
        transform: translateY(0) scale(0.9);
        opacity: 0.45;
    }
    16% {
        transform: translateY(-2px) scale(1.05);
        opacity: 1;
    }
    33% {
        transform: translateY(0) scale(0.95);
        opacity: 0.5;
    }
    100% {
        transform: translateY(0) scale(0.9);
        opacity: 0.45;
    }
}

.friend-darkweb-tab-active,
.friend-darkweb-mini-btn-primary {
    background: linear-gradient(135deg, #1e2e46, #34557b);
    color: #eef7ff;
}

.friend-darkweb-tab {
    flex: 1;
    min-width: 0;
}

.friend-darkweb-rules-card {
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(10, 18, 30, 0.94), rgba(31, 48, 73, 0.92));
    color: #eaf4ff;
    padding: 14px 16px;
    box-shadow: 0 12px 24px rgba(19, 30, 46, 0.18);
}

.friend-darkweb-rules-title,
.friend-darkweb-sidebar-head,
.friend-darkweb-detail-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.friend-darkweb-rules-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    font-size: 12px;
    line-height: 1.6;
}

.friend-darkweb-content-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
}

.friend-darkweb-feed,
.friend-darkweb-detail-content {
    height: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    padding: 10px;
    backdrop-filter: blur(10px);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    /* 隐形滚动条，仍可触摸/滚轮滚动 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.friend-darkweb-feed::-webkit-scrollbar,
.friend-darkweb-detail-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

.friend-darkweb-detail-main-wrap .friend-darkweb-detail-main,
#friend-darkweb-detail-main-wrap .twitter-x-detail-root,
#friend-darkweb-detail-content .friend-darkweb-detail-main {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

#friend-darkweb-detail-content .friend-darkweb-detail-main .tweet-text,
#friend-darkweb-detail-content .friend-darkweb-detail-main .friend-darkweb-thread-title {
    white-space: normal;
    word-break: break-word;
}

.friend-darkweb-comments-wrap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(16, 32, 52, 0.1);
}

.friend-darkweb-comments-heading {
    font-size: 14px;
    font-weight: 700;
    color: #0d1b2a;
    margin: 0 0 10px;
}

#friend-darkweb-comments-list .friend-darkweb-comments-list-inner,
#friend-darkweb-comments-list {
    display: block;
    max-width: 100%;
}

#friend-darkweb-detail-content .friend-darkweb-cfloor,
#friend-darkweb-comments-list .friend-darkweb-cfloor {
    box-sizing: border-box;
    margin: 0 0 5px;
    padding: 10px 10px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(16, 32, 52, 0.08);
}

#friend-darkweb-detail-content .friend-darkweb-cfloor-children,
#friend-darkweb-comments-list .friend-darkweb-cfloor-children {
    margin: 4px 0 0 8px;
    padding: 0 0 0 8px;
    border-left: 2px solid rgba(52, 85, 123, 0.2);
}

#friend-darkweb-detail-content .friend-darkweb-cfloor[data-depth="0"] .friend-darkweb-cfloor-children .friend-darkweb-cfloor,
#friend-darkweb-comments-list .friend-darkweb-cfloor[data-depth="0"] .friend-darkweb-cfloor-children .friend-darkweb-cfloor {
    background: rgba(245, 248, 252, 0.95);
}

#friend-darkweb-detail-content .friend-darkweb-cfloor-head,
#friend-darkweb-comments-list .friend-darkweb-cfloor-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    font-size: 12px;
    margin-bottom: 6px;
}

#friend-darkweb-detail-content .friend-darkweb-c-name,
#friend-darkweb-comments-list .friend-darkweb-c-name {
    font-weight: 700;
    color: #102033;
}

#friend-darkweb-detail-content .friend-darkweb-anon,
#friend-darkweb-comments-list .friend-darkweb-anon {
    color: #5f6e80;
    font-size: 11px;
}

#friend-darkweb-detail-content .friend-darkweb-c-time,
#friend-darkweb-comments-list .friend-darkweb-c-time {
    margin-left: auto;
    font-size: 11px;
    color: #8b98a8;
}

#friend-darkweb-detail-content .friend-darkweb-c-body,
#friend-darkweb-comments-list .friend-darkweb-c-body {
    font-size: 13px;
    line-height: 1.6;
    color: #1e3042;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

#friend-darkweb-detail-content .friend-darkweb-c-votes,
#friend-darkweb-comments-list .friend-darkweb-c-votes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 8px;
    font-size: 11px;
    color: #6b7788;
}

/* 暗网论坛：帖子列表（主题 + 摘要 + 分区） */
#friend-darkweb-feed .tweet-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friend-darkweb-forum-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friend-darkweb-feed .friend-darkweb-thread.tweet {
    margin: 0;
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(16, 32, 52, 0.11);
    box-shadow: 0 2px 12px rgba(19, 30, 46, 0.07);
    cursor: pointer;
}

.friend-darkweb-feed .friend-darkweb-thread.tweet:active {
    box-shadow: 0 1px 6px rgba(19, 30, 46, 0.1);
}

.friend-darkweb-thread .friend-darkweb-thread-head,
.friend-darkweb-thread .tweet-header.friend-darkweb-thread-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 0 0 8px;
    font-size: 12px;
    color: #5a6b7d;
}

.friend-darkweb-thread .tweet-name,
.friend-darkweb-thread .display-name {
    font-weight: 700;
    color: #102033;
}

.friend-darkweb-thread .tweet-handle,
.friend-darkweb-thread .handle {
    color: #5f6e80;
}

.friend-darkweb-thread .tweet-time,
.friend-darkweb-thread .time {
    margin-left: auto;
    font-size: 11px;
    color: #8b98a8;
}

.friend-darkweb-thread-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.38;
    color: #0d1b2a;
}

.friend-darkweb-thread-summary,
.friend-darkweb-thread .friend-darkweb-thread-summary {
    font-size: 13px;
    line-height: 1.65;
    color: #2c3d4f;
    margin: 0 0 10px;
}

.friend-darkweb-thread-summary p,
.friend-darkweb-thread .friend-darkweb-thread-summary p {
    margin: 0 0 0.45em;
}

.friend-darkweb-thread-summary p:last-child,
.friend-darkweb-thread .friend-darkweb-thread-summary p:last-child {
    margin-bottom: 0;
}

.friend-darkweb-thread-meta,
.friend-darkweb-thread .friend-darkweb-thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(16, 32, 52, 0.08);
    font-size: 11px;
    color: #6b7788;
}

.friend-darkweb-thread-meta span,
.friend-darkweb-thread .friend-darkweb-thread-meta span {
    white-space: nowrap;
}

.friend-darkweb-empty {
    border-radius: 16px;
    background: rgba(19, 28, 42, 0.06);
    color: #324760;
    padding: 18px 14px;
    font-size: 13px;
    line-height: 1.7;
}

/* 全屏轻遮罩：点空白关档案，不挡顶栏/底栏（z-index 低于二者） */
.friend-darkweb-sidebar-scrim {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(4, 10, 20, 0.12);
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    animation: friend-darkweb-scrim-in 0.3s ease;
}
@keyframes friend-darkweb-scrim-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.friend-darkweb-sidebar {
    position: absolute;
    top: auto;
    right: 8px;
    bottom: 8px;
    left: auto;
    z-index: 8;
    width: min(92%, 300px);
    max-width: calc(100% - 16px);
    max-height: min(50vh, 50%);
    min-height: 0;
    height: auto;
    padding: 12px 14px 14px;
    /* 约 10% 实色 + 大模糊 呈现「约 90% 透明感」磨砂玻璃；正文辅以阴影保证可读性 */
    background: linear-gradient(145deg, rgba(18, 28, 44, 0.12) 0%, rgba(8, 14, 24, 0.08) 100%);
    backdrop-filter: blur(20px) saturate(1.12);
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 20px;
    color: #f0f6ff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.1),
        0 12px 40px rgba(6, 12, 24, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translate3d(108%, 0, 0);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    /* 内部可滚动，滚动条与主贴区一致隐去 */
    scrollbar-width: none;
    -ms-overflow-style: none;
    pointer-events: none;
}
.friend-darkweb-sidebar--settings {
    padding-bottom: 8px;
}
.friend-darkweb-sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}
.friend-darkweb-sidebar .friend-darkweb-field textarea {
    min-height: 64px;
    max-height: 100px;
}

.friend-darkweb-sidebar-open {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
    will-change: auto;
}

/* 仅首页：底栏与身份卡同处下方时，把侧栏整体上移，保证「个人信息设置」等可点 */
.friend-darkweb-shell-hub .friend-darkweb-sidebar {
    bottom: calc(8px + var(--friend-darkweb-bottom-nav-stack, 68px));
}

.friend-darkweb-id-card {
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.friend-darkweb-id-name,
.friend-darkweb-id-alias,
.friend-darkweb-id-level {
    font-weight: 600;
}

.friend-darkweb-id-alias {
    font-size: 14px;
    line-height: 1.35;
}

.friend-darkweb-id-alias--btn {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}

.friend-darkweb-id-alias--btn:hover,
.friend-darkweb-id-alias--btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.friend-darkweb-id-alias-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(232, 242, 255, 0.6);
    margin-right: 2px;
}

.friend-darkweb-id-alias-value {
    font-size: 15px;
    font-weight: 700;
    color: #f4f8ff;
    word-break: break-word;
}

.friend-darkweb-id-edit {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: #6eb4ff;
    white-space: nowrap;
}

.friend-darkweb-field-hint {
    margin: 0 0 12px;
    padding: 0 2px;
    font-size: 11px;
    line-height: 1.55;
    color: rgba(232, 242, 255, 0.6);
}

.friend-darkweb-field-hint .friend-darkweb-card-ref,
.friend-darkweb-card-ref {
    color: #b6d4ff;
    font-weight: 600;
}

.friend-darkweb-sidebar-panels {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.friend-darkweb-sidebar-panel {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.friend-darkweb-sidebar-panel-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #f0f6ff;
}

.friend-darkweb-sidebar-panel-placeholder {
    font-size: 11px;
    line-height: 1.5;
    color: rgba(232, 242, 255, 0.55);
}

.friend-darkweb-id-bio,
.friend-darkweb-sidebar-note {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(232, 242, 255, 0.78);
}

.friend-darkweb-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 12px;
}

.friend-darkweb-field input,
.friend-darkweb-field textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #eef7ff;
    padding: 10px 12px;
    font: inherit;
    text-shadow: none;
}

.friend-darkweb-field textarea {
    min-height: 90px;
    resize: vertical;
}

.friend-darkweb-sidebar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.friend-darkweb-detail-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px 10px;
}

.friend-darkweb-detail-bar .friend-darkweb-detail-title {
    text-align: center;
    margin-bottom: 0;
    min-width: 0;
}

.friend-darkweb-detail-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(180deg, #eef3f8 0%, #dfe7f2 100%);
    overflow-x: hidden;
    box-sizing: border-box;
    min-width: 0;
}

.home-screen-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#home-screen > .status-bar,
#home-screen > .home-scroll-wrapper,
#home-screen > .bottom-nav {
    position: relative;
    z-index: 1;
}

/* 主题编辑页 */
.theme-page-root {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #f0f2f5;
}

.theme-page-root.active {
    display: flex;
}

.theme-page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    flex-shrink: 0;
}

.theme-page-header .back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.theme-page-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.theme-page-header-spacer {
    position: absolute;
    right: 16px;
    width: 36px;
    height: 1px;
}

.theme-page-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 12px 100px;
    -webkit-overflow-scrolling: touch;
}

.theme-section-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.theme-section-head {
    margin-bottom: 12px;
}

.theme-section-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #111;
}

.theme-section-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    line-height: 1.4;
}

.theme-section-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.theme-thumb-wrap {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    border: 1px dashed #ccc;
    background: #fafafa;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-thumb-wrap.has-image {
    border-style: solid;
    border-color: #e0e0e0;
}

.theme-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.theme-thumb-placeholder {
    font-size: 12px;
    color: #aaa;
    padding: 8px;
    text-align: center;
}

.theme-section-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.theme-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
}

.theme-btn-secondary {
    background: #07c160;
    color: #fff;
}

.theme-btn-secondary:active {
    opacity: 0.9;
}

.theme-btn-ghost {
    background: #f5f5f5;
    color: #555;
}

.theme-icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.theme-icon-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.theme-icon-preview {
    width: 100%;
    aspect-ratio: 1;
    max-width: 64px;
    padding: 0;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-icon-label {
    font-size: 11px;
    color: #444;
}

.theme-mini-link {
    border: none;
    background: none;
    color: #576b95;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 0;
}

.theme-page-footer {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

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

.theme-footer-cancel {
    background: #f0f0f0;
    color: #333;
}

.theme-footer-save {
    background: #07c160;
    color: #fff;
}

.stub-app-body {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.stub-app-text {
    font-size: 15px;
    color: #888;
}

#shopping-page {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #f4f4f4;
    position: relative;
    overflow: hidden;
}

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

/* 购物：顶栏搜索 + 分类横滑 + 双列线性图卡片 */
.shopping-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 10px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.shopping-toolbar-title .shopping-toolbar-center-title {
    flex: 1;
    margin: 0;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #111;
}

.shopping-toolbar-title .shopping-toolbar-spacer {
    width: 40px;
    height: 38px;
    flex-shrink: 0;
}

.shopping-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.shopping-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.shopping-view.is-active {
    display: flex;
}

.shopping-view-home .shopping-feed {
    padding-bottom: 8px;
}

.shopping-tool-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #f5f5f5;
    color: #333;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.shopping-tool-btn:active {
    opacity: 0.85;
}

.shopping-search-wrap {
    flex: 1;
    min-width: 0;
}

.shopping-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    border: none;
    border-radius: 19px;
    background: #f0f0f0;
    padding: 0 16px;
    font-size: 14px;
    color: #333;
    outline: none;
}

.shopping-search-input::placeholder {
    color: #999;
}

.shopping-category-outer {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 6px;
}

.shopping-category-hint {
    font-size: 10px;
    color: #aaa;
    padding: 4px 12px 2px;
    margin: 0;
    line-height: 1.3;
}

.shopping-category-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    touch-action: pan-x;
    padding: 6px 12px 8px;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.shopping-category-strip::-webkit-scrollbar {
    display: none;
}

.shopping-category-strip:active {
    cursor: grabbing;
}

.shopping-cat-pill {
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    color: #333;
    background: #f3f3f3;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.shopping-cat-pill.is-active {
    background: linear-gradient(135deg, #ff5000 0%, #ff2d4a 100%);
    color: #fff;
    font-weight: 600;
}

.shopping-feed {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 10px 16px;
    position: relative;
}

.shopping-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shopping-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.shopping-product-card:active {
    opacity: 0.92;
}

.shopping-line-art {
    position: relative;
    width: 100%;
    height: 148px;
    overflow: hidden;
}

.shopping-line-art::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.45;
    pointer-events: none;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.15) 0,
        rgba(255, 255, 255, 0.15) 1px,
        transparent 1px,
        transparent 14px
    );
}

.shopping-line-art[data-line="1"] {
    background: linear-gradient(160deg, #fff8f0 0%, #ffd8c8 40%, #ff9a76 100%);
}

.shopping-line-art[data-line="2"] {
    background: linear-gradient(145deg, #f0f7ff 0%, #c8ddff 45%, #6b9fff 100%);
}

.shopping-line-art[data-line="3"] {
    background: linear-gradient(155deg, #f5fff5 0%, #c8f5dd 40%, #3ecf8e 100%);
}

.shopping-line-art[data-line="4"] {
    background: linear-gradient(135deg, #faf5ff 0%, #e0c8ff 45%, #9f7aea 100%);
}

.shopping-line-art[data-line="5"] {
    background: linear-gradient(150deg, #fffef5 0%, #ffe8a8 42%, #f6ad55 100%);
}

.shopping-line-art[data-line="6"] {
    background: linear-gradient(140deg, #f5f8fa 0%, #cbd5e0 50%, #718096 100%);
}

.shopping-line-art::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    top: 22%;
    bottom: 28%;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    pointer-events: none;
    transform: rotate(-4deg);
}

.shopping-line-art--thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
}

.shopping-line-art--thumb::after {
    left: 10%;
    right: 10%;
    top: 18%;
    bottom: 22%;
    border-width: 1.5px;
    transform: rotate(-3deg);
}

.shopping-product-info {
    padding: 10px 10px 12px;
}

.shopping-product-name {
    font-size: 13px;
    line-height: 1.35;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    word-break: break-word;
}

.shopping-product-price {
    margin-top: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #ff5000;
}

.shopping-empty-hint {
    display: none;
    text-align: center;
    padding: 48px 24px;
    color: #999;
    font-size: 14px;
}

.shopping-empty-hint p {
    margin: 0 0 8px;
}

.shopping-empty-sub {
    font-size: 12px !important;
    color: #bbb !important;
}

/* 购物车（淘宝式列表 + 底栏结算） */
.shopping-cart-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 10px 8px;
    background: #ebebeb;
}

.shopping-cart-store {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.shopping-cart-store-title {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    border-bottom: 1px solid #f0f0f0;
}

.shopping-cart-list {
    padding: 0;
}

.shopping-cart-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px;
    border-bottom: 1px solid #f5f5f5;
}

.shopping-cart-row:last-child {
    border-bottom: none;
}

.shopping-cart-check {
    flex-shrink: 0;
    margin-top: 28px;
    width: 18px;
    height: 18px;
    accent-color: #ff5000;
}

.shopping-cart-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 10px;
}

.shopping-cart-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shopping-cart-name {
    font-size: 13px;
    color: #222;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.shopping-cart-meta {
    font-size: 11px;
    color: #999;
}

.shopping-cart-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.shopping-cart-unit {
    font-size: 15px;
    font-weight: 700;
    color: #ff5000;
}

.shopping-cart-qty {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.shopping-cart-qty button {
    width: 28px;
    height: 28px;
    border: none;
    background: #fafafa;
    font-size: 18px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 0;
}

.shopping-cart-qty span {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    color: #333;
}

.shopping-cart-del {
    margin-top: 6px;
    border: none;
    background: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    align-self: flex-start;
}

.shopping-cart-empty {
    display: none;
    text-align: center;
    padding: 40px 20px 24px;
    background: #fff;
    border-radius: 12px;
    margin: 10px;
}

.shopping-cart-empty.is-visible {
    display: block;
}

.shopping-cart-empty p {
    margin: 0 0 8px;
    color: #888;
    font-size: 14px;
}

.shopping-cart-empty-sub {
    font-size: 12px !important;
    color: #bbb !important;
    margin-bottom: 16px !important;
}

.shopping-cart-gohome-btn {
    border: none;
    background: linear-gradient(135deg, #ff5000 0%, #ff2d4a 100%);
    color: #fff;
    padding: 10px 28px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}

.shopping-cart-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.shopping-cart-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    flex-shrink: 0;
}

.shopping-cart-select-all input {
    width: 18px;
    height: 18px;
    accent-color: #ff5000;
}

.shopping-cart-total-block {
    flex: 1;
    min-width: 0;
    text-align: right;
    font-size: 13px;
    color: #333;
}

.shopping-cart-total-price {
    font-size: 18px;
    color: #ff5000;
    font-weight: 700;
    margin-left: 4px;
}

.shopping-cart-settle {
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #ff5000 0%, #ff2d4a 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.shopping-cart-settle:active {
    opacity: 0.9;
}

/* 购物 · 我的（简约线框图标） */
.shopping-view-profile {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    padding-bottom: 12px;
}

.shop-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px 20px;
}

.shop-profile-avatar {
    position: relative;
    overflow: hidden;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shop-profile-avatar-btn {
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.shop-profile-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#shop-profile-avatar-ph {
    position: relative;
    z-index: 1;
}

.shop-profile-nick-btn {
    border: none;
    background: none;
    font-size: 17px;
    font-weight: 700;
    color: #111;
    text-align: left;
    padding: 4px 0;
    cursor: pointer;
}

.shop-profile-divider {
    height: 8px;
    background: #f4f4f4;
    border: none;
    margin: 0;
}

.shop-profile-grid {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 20px 8px 18px;
    background: #fff;
}

.shop-profile-cell {
    flex: 1;
    max-width: 25%;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 4px;
    -webkit-tap-highlight-color: transparent;
    color: #333;
}

.shop-profile-cell span {
    font-size: 12px;
    color: #555;
    line-height: 1.2;
    text-align: center;
}

.shop-profile-icon {
    width: 36px;
    height: 36px;
    color: #111;
}

.shop-profile-cell:active {
    opacity: 0.75;
}

.shop-profile-cell--order {
    position: relative;
}

.shop-order-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff5000;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    line-height: 1;
}

.shopping-checkout-pay-hint {
    font-size: 12px !important;
    color: #888 !important;
    margin-top: -2px !important;
}

.shopping-checkout-method-list {
    max-height: 260px;
}

.shopping-checkout-ship-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.shopping-checkout-ship-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.shopping-checkout-ship-line {
    margin: 0 0 6px;
    font-size: 12px;
    color: #666;
    line-height: 1.45;
    word-break: break-all;
}

.shopping-profile-edit-body {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.shopping-profile-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 12px 0 6px;
}

.shopping-profile-label:first-child {
    margin-top: 0;
}

.shopping-profile-avatar-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.shopping-profile-preview-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.shopping-profile-preview-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shopping-profile-preview-ph {
    font-size: 11px;
    color: #999;
    padding: 4px;
    text-align: center;
    line-height: 1.2;
}

.shopping-profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 120px;
}

.shopping-profile-mini-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
}

.shopping-profile-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.shopping-profile-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 72px;
}

.shopping-order-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.shopping-order-list-header h3 {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.shopping-order-back-btn {
    border: none;
    background: none;
    font-size: 26px;
    line-height: 1;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    color: #111;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.shopping-order-header-spacer {
    width: 36px;
    flex-shrink: 0;
}

.shopping-order-list-body {
    max-height: min(420px, 72vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.shopping-order-empty {
    text-align: center;
    color: #888;
    padding: 28px 12px;
    font-size: 14px;
}

.shopping-order-card {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fafafa;
}

.shopping-order-line {
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.35;
}

.shopping-order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e5e5;
}

.shopping-order-total {
    font-size: 15px;
    font-weight: 600;
    color: #ff5000;
}

.shopping-order-action-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff5000 0%, #ff2d4a 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.shopping-order-action-btn:active {
    opacity: 0.9;
}

.chat-gift-shelf-sub {
    margin-bottom: 8px !important;
}

.chat-gift-shelf-list {
    max-height: min(360px, 58vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-gift-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.chat-gift-item:last-child {
    border-bottom: none;
}

.chat-gift-empty {
    color: #888;
    font-size: 14px;
    padding: 16px 0;
    line-height: 1.5;
}

.chat-gift-item-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.chat-gift-item-meta {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.chat-gift-item-info {
    flex: 1;
    min-width: 0;
}

.chat-gift-send-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 7px 12px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.chat-gift-send-btn:active {
    opacity: 0.88;
}

.chat-gift-check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 4px;
}

.chat-gift-check input {
    width: 18px;
    height: 18px;
    accent-color: #ff7eb3;
}

.chat-gift-shelf-footer {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.chat-gift-shelf-footer .wallet-modal-btn {
    width: 100%;
}

/* 购物底栏 */
.shopping-bottom-nav {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom, 0px));
    z-index: 20;
}

.shopping-tab-btn {
    position: relative;
    flex: 1;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
    cursor: pointer;
    color: #999;
    font-size: 10px;
    -webkit-tap-highlight-color: transparent;
}

.shopping-tab-btn.is-active {
    color: #ff5000;
}

.shopping-tab-icon {
    width: 24px;
    height: 24px;
}

.shopping-tab-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    margin-left: 8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff5000;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
}

.shopping-loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    z-index: 80;
    align-items: center;
    justify-content: center;
}

.shopping-loading-overlay.show {
    display: flex;
}

.shopping-loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #555;
}

.shopping-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #ff5000;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

#phone-page,
#twitter-page {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #f8f8f8;
}

#twitter-page {
    position: relative;
}

#phone-page.active,
#twitter-page.active {
    display: flex;
}

#twitter-page.active .books-header,
#twitter-page.active .twitter-app-header {
    background: #fff;
    border-bottom: 1px solid #eff3f4;
}

#twitter-page.active .books-header h1,
#twitter-page.active .twitter-app-title {
    color: #0f1419;
}

#twitter-page.active .back-btn,
#twitter-page.active .books-header-btn {
    transition: transform 0.3s ease, background 0.2s;
    color: #0f1419;
    fill: #0f1419;
}

.twitter-app-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 8px 12px;
    flex-shrink: 0;
}

.twitter-app-back.back-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0;
    justify-self: start;
}

.twitter-app-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    justify-self: center;
    letter-spacing: -0.02em;
}

.twitter-app-title-slash {
    color: #536471;
    font-weight: 600;
    margin: 0 2px;
}

.twitter-app-header .twitter-refresh-btn {
    justify-self: end;
}

.twitter-app-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
}

.twitter-view {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.twitter-view.twitter-view-active {
    display: flex;
}

.twitter-feed-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid #eff3f4;
    background: #fff;
}

.twitter-feed-tab {
    flex: 1;
    padding: 14px 8px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: #536471;
    cursor: pointer;
    position: relative;
}

.twitter-feed-tab:hover {
    background: rgba(15, 20, 25, 0.04);
}

.twitter-feed-tab.active {
    color: #0f1419;
    font-weight: 700;
}

.twitter-feed-tab.active::after {
    content: "";
    position: absolute;
    left: 25%;
    right: 25%;
    bottom: 0;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: #1d9bf0;
}

.twitter-feed-panels {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #E7E8EA;
}

.twitter-feed-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 20, 25, 0.14) transparent;
}

.twitter-feed-panel:hover {
    scrollbar-color: rgba(15, 20, 25, 0.28) transparent;
}

.twitter-feed-panel::-webkit-scrollbar {
    width: 5px;
}

.twitter-feed-panel::-webkit-scrollbar-track {
    background: transparent;
}

.twitter-feed-panel::-webkit-scrollbar-thumb {
    background: rgba(15, 20, 25, 0.12);
    border-radius: 100px;
}

.twitter-feed-panel:hover::-webkit-scrollbar-thumb {
    background: rgba(15, 20, 25, 0.24);
}

.twitter-feed-panel.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* 时间轴面板在 flex 子项内须 min-height:0，否则会被 .twitter-body 的 min-height:100% 撑满视口、无法出现内部滚动 */
.twitter-feed-panels > .twitter-feed-panel {
    min-height: 0;
}

.twitter-messages-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    color: #536471;
    background: #fff;
}

.twitter-messages-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: #0f1419;
}

.twitter-messages-hint {
    margin: 0;
    font-size: 15px;
}

/* —— 个人主页（参考 X 布局） —— */
.twitter-view-profile {
    overflow: hidden;
    background: #fff;
}

.twitter-profile-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    padding: 0;
}

.twitter-profile-banner {
    height: 112px;
    /* 仅设置底色，勿用 background 简写，否则会与 JS 设置的 background-image 在部分环境下互相覆盖 */
    background-color: #1d9bf0;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    transition: filter 0.2s;
}

.twitter-profile-banner:hover {
    filter: brightness(0.85);
}

.twitter-profile-banner-overlay {
    display: none;
    position: absolute;
    inset: 0;
    height: 96px;
    background: rgba(0, 0, 0, 0.35);
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.twitter-profile-banner:hover .twitter-profile-banner-overlay {
    display: flex;
}

.twitter-profile-sheet {
    padding: 0 22px 28px;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

.twitter-profile-avatar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: -40px;
    margin-bottom: 12px;
    gap: 12px;
    padding-right: 2px;
}

.twitter-profile-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #1d9bf0;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: opacity 0.2s;
}

.twitter-profile-avatar-wrap:hover {
    opacity: 0.85;
}

.twitter-profile-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
}

.twitter-profile-avatar-letter {
    position: relative;
    z-index: 1;
}

.twitter-profile-edit-btn {
    margin-bottom: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #cfd9de;
    background: #fff;
    color: #0f1419;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.twitter-profile-edit-btn:hover {
    background: rgba(15, 20, 25, 0.04);
}

.twitter-profile-name {
    font-size: 20px;
    font-weight: 800;
    color: #0f1419;
    line-height: 1.25;
    padding-right: 4px;
    word-break: break-word;
}

.twitter-profile-handle {
    font-size: 15px;
    color: #536471;
    margin-top: 6px;
    padding-right: 4px;
    word-break: break-all;
}

.twitter-profile-bio {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.45;
    color: #0f1419;
    white-space: pre-wrap;
}

.twitter-profile-joined {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 14px;
    color: #536471;
}

.twitter-profile-joined-icon {
    display: flex;
    opacity: 0.85;
}

.twitter-profile-stats {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    font-size: 14px;
    color: #0f1419;
}

.twitter-profile-stats strong {
    font-weight: 800;
}

.twitter-profile-tabs {
    display: flex;
    margin-top: 16px;
    border-bottom: 1px solid #eff3f4;
}

.twitter-profile-tab {
    flex: 1;
    padding: 16px 4px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: #536471;
    cursor: pointer;
    position: relative;
}

.twitter-profile-tab.active {
    color: #0f1419;
    font-weight: 700;
}

.twitter-profile-tab.active::after {
    content: "";
    position: absolute;
    left: 15%;
    right: 15%;
    bottom: 0;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: #1d9bf0;
}

.twitter-profile-tab-panels {
    min-height: 180px;
}

.twitter-profile-tab-panel {
    padding: 20px 0 24px;
}

.twitter-profile-empty {
    text-align: center;
    color: #536471;
    font-size: 15px;
    margin: 40px 8px;
    padding: 0 8px;
    line-height: 1.5;
}

.twitter-bottom-nav {
    display: flex;
    flex-shrink: 0;
    border-top: 1px solid #eff3f4;
    background: #fff;
    padding: 6px 0 10px;
    justify-content: space-around;
    align-items: center;
}

.twitter-bottom-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border: none;
    background: none;
    color: #536471;
    cursor: pointer;
    font-size: 11px;
}

.twitter-bottom-btn .twitter-bottom-icon {
    width: 26px;
    height: 26px;
}

.twitter-bottom-btn.active {
    color: #0f1419;
    font-weight: 700;
}

.twitter-bottom-label {
    line-height: 1.2;
}

.twitter-profile-edit-modal-content {
    max-width: 400px;
}

.twitter-edit-static-hint {
    margin: -4px 0 12px;
    padding: 0 2px;
    font-size: 13px;
    line-height: 1.55;
    color: #536471;
}

.twitter-edit-joined-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #0f1419;
}

.twitter-edit-joined-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.twitter-edit-joined-select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 14px;
}

/* 推特正在关注好友选择模态框 */
.twitter-following-picker-modal-content {
    max-width: 380px;
    width: 92%;
}

.twitter-following-picker-list {
    display: flex;
    flex-direction: column;
}

.twitter-following-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
}

.twitter-following-picker-item:hover {
    background: #f7f9f9;
}

.twitter-following-picker-item.selected {
    background: #e8f5fe;
}

.twitter-following-picker-avatar {
    position: relative;
    flex-shrink: 0;
}

.twitter-following-picker-avatar img,
.twitter-following-picker-avatar .avatar-letter {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.twitter-following-picker-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1d9bf0;
    border: 2px solid #fff;
    display: none;
    align-items: center;
    justify-content: center;
}

.twitter-following-picker-item.selected .twitter-following-picker-check {
    display: flex;
}

.twitter-following-picker-check svg {
    width: 10px;
    height: 10px;
    fill: #fff;
}

.twitter-following-picker-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.twitter-following-picker-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f1419;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.twitter-following-picker-handle {
    font-size: 14px;
    color: #536471;
    margin-top: 1px;
}

.twitter-following-picker-empty {
    color: #536471;
    font-size: 15px;
    text-align: center;
    padding: 32px 16px;
}

.twitter-following-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid #eff3f4;
}

.twitter-following-picker-tip {
    font-size: 13px;
    color: #536471;
}

.twitter-following-picker-footer .btn-save {
    padding: 7px 20px;
    font-size: 14px;
}

#twitter-profile-edit-modal .modal-footer.twitter-profile-edit-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 12px 20px;
    height: auto;
    flex-wrap: wrap;
    border-top: 1px solid #eff3f4;
}

#twitter-profile-edit-modal .twitter-profile-edit-footer .btn-cancel,
#twitter-profile-edit-modal .twitter-profile-edit-footer .btn-save {
    width: auto;
    min-width: 112px;
    height: 44px;
    padding: 0 28px;
    border-radius: 999px;
    flex: 0 0 auto;
}

#twitter-profile-edit-modal .twitter-profile-edit-footer .btn-cancel {
    border: 1px solid #cfd9de;
    border-right: 1px solid #cfd9de;
}

#twitter-profile-edit-modal .twitter-profile-edit-footer .btn-save {
    border: none;
}

.twitter-refresh-btn.refreshing {
    animation: twitter-spin 0.8s linear infinite;
}

@keyframes twitter-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#twitter-page.active .back-btn:hover,
#twitter-page.active .books-header-btn:hover {
    background: rgba(15, 20, 25, 0.08);
}

.twitter-body {
    flex: 1;
    overflow-y: auto;
    background: #E7E8EA;
    min-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 20, 25, 0.14) transparent;
}

/* 嵌在 .twitter-feed-panels 内的时间轴由父级 flex 分配高度，禁止 min-height:100% 撑破滚动链 */
.twitter-feed-panels > .twitter-body {
    min-height: 0;
}

.twitter-body:hover {
    scrollbar-color: rgba(15, 20, 25, 0.28) transparent;
}

.twitter-body::-webkit-scrollbar {
    width: 5px;
}

.twitter-body::-webkit-scrollbar-track {
    background: transparent;
}

.twitter-body::-webkit-scrollbar-thumb {
    background: rgba(15, 20, 25, 0.12);
    border-radius: 100px;
}

.twitter-body:hover::-webkit-scrollbar-thumb {
    background: rgba(15, 20, 25, 0.24);
}

.twitter-body .tweet-container {
    max-width: 520px;
    margin: 0 auto;
}

/* 推文列表整体（与 !important 规则配合，压过 API 内联暗色） */
.twitter-body {
    background: #E7E8EA;
    color: #0f1419;
}

#twitter-body-following,
#twitter-body-foryou,
#twitter-body-entertainment,
.twitter-feed-panel {
    background-color: #E7E8EA;
}

#twitter-body-following .tweet-container,
#twitter-body-foryou .tweet-container,
#twitter-body-entertainment .tweet-container {
    background-color: #E7E8EA !important;
    color: #0f1419 !important;
}

#twitter-body-following .tweet,
#twitter-body-foryou .tweet,
#twitter-body-entertainment .tweet {
    background-color: #E7E8EA !important;
}

#twitter-body-following .tweet-header,
#twitter-body-following .tweet-text,
#twitter-body-following .tweet-content-col,
#twitter-body-following .tweet-content,
#twitter-body-following p,
#twitter-body-following .tweet-name,
#twitter-body-foryou .tweet-header,
#twitter-body-foryou .tweet-text,
#twitter-body-foryou .tweet-content-col,
#twitter-body-foryou .tweet-content,
#twitter-body-foryou p,
#twitter-body-foryou .tweet-name,
#twitter-body-entertainment .tweet-header,
#twitter-body-entertainment .tweet-text,
#twitter-body-entertainment .tweet-content-col,
#twitter-body-entertainment .tweet-content,
#twitter-body-entertainment p,
#twitter-body-entertainment .tweet-name {
    color: #0f1419 !important;
}

#twitter-body-following .tweet-handle,
#twitter-body-following .tweet-time,
#twitter-body-following .tweet-interactions,
#twitter-body-following .tweet-interactions span,
#twitter-body-following .tweet-interactions svg,
#twitter-body-foryou .tweet-handle,
#twitter-body-foryou .tweet-time,
#twitter-body-foryou .tweet-interactions,
#twitter-body-foryou .tweet-interactions span,
#twitter-body-foryou .tweet-interactions svg,
#twitter-body-entertainment .tweet-handle,
#twitter-body-entertainment .tweet-time,
#twitter-body-entertainment .tweet-interactions,
#twitter-body-entertainment .tweet-interactions span,
#twitter-body-entertainment .tweet-interactions svg {
    color: #536471 !important;
    fill: #536471 !important;
}

#twitter-body-following .tweet-avatar-wrap,
#twitter-body-following .tweet-avatar-wrap span,
#twitter-body-foryou .tweet-avatar-wrap,
#twitter-body-foryou .tweet-avatar-wrap span,
#twitter-body-entertainment .tweet-avatar-wrap,
#twitter-body-entertainment .tweet-avatar-wrap span {
    color: #fff !important;
}

#twitter-body-following a,
#twitter-body-foryou a,
#twitter-body-entertainment a {
    color: #1d9bf0 !important;
}

#twitter-body-following .tweet-replies,
#twitter-body-foryou .tweet-replies,
#twitter-body-entertainment .tweet-replies {
    border-top: 1px solid #cdd0d4;
    margin-top: 8px;
    padding-top: 8px;
}
#twitter-body-following .tweet-reply,
#twitter-body-foryou .tweet-reply,
#twitter-body-entertainment .tweet-reply {
    border-top: 1px solid #eff3f4;
    padding: 10px 0;
}
#twitter-body-following .tweet-reply:first-child,
#twitter-body-foryou .tweet-reply:first-child,
#twitter-body-entertainment .tweet-reply:first-child {
    border-top: none;
}
#twitter-body-following .tweet-reply .tweet-text,
#twitter-body-foryou .tweet-reply .tweet-text,
#twitter-body-entertainment .tweet-reply .tweet-text {
    color: #0f1419 !important;
}

#twitter-body-following .tweet,
#twitter-body-foryou .tweet,
#twitter-body-entertainment .tweet {
    cursor: pointer;
}
#twitter-body-following .tweet-main:hover .tweet-text,
#twitter-body-following .tweet:hover .tweet-text,
#twitter-body-foryou .tweet-main:hover .tweet-text,
#twitter-body-foryou .tweet:hover .tweet-text,
#twitter-body-entertainment .tweet-main:hover .tweet-text,
#twitter-body-entertainment .tweet:hover .tweet-text {
    text-decoration: underline;
}

/* 模型常用语义化 class（.twitter-x-timeline / .avatar-col 等），由 App CSS 渲染，禁止模型输出样式表 */
.twitter-body .twitter-x-timeline {
    background-color: #E7E8EA;
    color: #0f1419;
    max-width: 600px;
    margin: 0 auto;
    padding: 8px 0;
    box-sizing: border-box;
}
.twitter-body .tweet-main {
    display: flex;
    flex-direction: row;
}
.twitter-body .avatar-col {
    margin-right: 12px;
    flex-shrink: 0;
}
.twitter-body .avatar-placeholder,
.twitter-body .reply-avatar-placeholder {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    user-select: none;
    flex-shrink: 0;
}
.twitter-body .avatar-placeholder {
    width: 48px;
    height: 48px;
    font-size: 18px;
}
.twitter-body .reply-avatar-placeholder {
    width: 36px;
    height: 36px;
    font-size: 14px;
    margin-right: 8px;
}
.twitter-body .content-col,
.twitter-body .reply-content {
    flex-grow: 1;
    min-width: 0;
}
.twitter-body .author-name,
.twitter-body .tweet-name {
    font-weight: 800;
    color: #0f1419;
    margin-right: 4px;
}
.twitter-body .author-handle,
.twitter-body .tweet-handle {
    color: #536471;
}
.twitter-body .tweet-time {
    color: #536471;
}
.twitter-body .tweet-text,
.twitter-body .reply-text {
    font-size: 15px;
    line-height: 20px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #0f1419;
}
.twitter-body .reply-text {
    font-size: 14px;
    line-height: 18px;
}
.twitter-body .tweet-actions {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
    margin-top: 12px;
    color: #536471;
    font-size: 13px;
}
.twitter-body .action-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.twitter-body .tweet-reply-section {
    padding-left: 60px;
    margin-top: 8px;
    border-top: 1px solid #eff3f4;
    padding-top: 8px;
}
.twitter-body .tweet-reply {
    display: flex;
    flex-direction: row;
    margin-bottom: 8px;
}
.twitter-body .reply-header {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 4px;
}

/* 推文详情页 */
.twitter-detail-page {
    display: none;
    position: absolute;
    inset: 0;
    background: #E7E8EA;
    z-index: 50;
    flex-direction: column;
}
.twitter-detail-page.show {
    display: flex;
}
.twitter-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #E7E8EA;
    border-bottom: 1px solid #cdd0d4;
    flex-shrink: 0;
}
.twitter-detail-back {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background 0.2s;
}
.twitter-detail-back:hover {
    background: rgba(0, 0, 0, 0.08);
}
.twitter-detail-title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    color: #000;
    text-align: center;
}
/* 与左侧返回按钮同宽，避免标题视觉偏移 */
.twitter-detail-header-spacer {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    pointer-events: none;
}
/* 关注流增量刷新：每轮 API 结果一批，便于上限裁剪 */
.twitter-feed-batch {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(15, 20, 25, 0.08);
}
.twitter-feed-panel .twitter-feed-batch:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.twitter-detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 32px 16px;
    color: #536471;
    gap: 16px;
}
.twitter-detail-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #cdd0d4;
    border-top-color: #1d9bf0;
    border-radius: 50%;
    animation: twitter-spin 0.85s linear infinite;
}
.twitter-detail-loading-text {
    margin: 0;
    font-size: 14px;
    color: #536471;
}

.twitter-x-detail-root {
    padding-bottom: 24px;
}

.twitter-detail-content {
    flex: 1;
    overflow-y: auto;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
    padding: 0 16px 24px;
    background-color: #E7E8EA;
    color: #0f1419;
}

/* 用户评论输入栏 */
.twitter-detail-comment-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid #cdd0d4;
    background: #E7E8EA;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}
.twitter-detail-comment-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1d9bf0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.twitter-detail-comment-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.twitter-detail-comment-input-wrap {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border: 1px solid #cdd0d4;
    border-radius: 20px;
    padding: 6px 12px;
    background: #fff;
}
.twitter-comment-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.5;
    color: #0f1419;
    background: transparent;
    max-height: 120px;
    overflow-y: auto;
}
.twitter-comment-input::placeholder {
    color: #536471;
}
.twitter-comment-submit-btn {
    background: none;
    border: none;
    color: #1d9bf0;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.twitter-comment-submit-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.twitter-comment-submit-btn:hover:not(:disabled) {
    opacity: 0.8;
}

/* 用户新追加的评论样式 */
.twitter-user-new-comment {
    border-top: 1px solid #eff3f4;
    padding-top: 10px;
    margin-top: 10px;
}

#twitter-detail-content,
#twitter-detail-content .tweet,
#twitter-detail-content .tweet-replies {
    background-color: #E7E8EA !important;
    color: #0f1419 !important;
}

#twitter-detail-content .tweet-name,
#twitter-detail-content .tweet-text,
#twitter-detail-content p {
    color: #0f1419 !important;
}

#twitter-detail-content .tweet-handle,
#twitter-detail-content .tweet-time,
#twitter-detail-content .tweet-interactions,
#twitter-detail-content .tweet-interactions span {
    color: #536471 !important;
}

#twitter-detail-content .tweet-avatar-wrap,
#twitter-detail-content .tweet-avatar-wrap span {
    color: #fff !important;
}

/* 推文详情页内的推文样式（亮色） */
.twitter-detail-content .tweet {
    border-bottom: 1px solid #eff3f4;
    padding: 12px 0;
}
.twitter-detail-content .tweet-name {
    color: #000;
}
.twitter-detail-content .tweet-handle,
.twitter-detail-content .tweet-time {
    color: #536471;
}
.twitter-detail-content .tweet-text {
    color: #0f1419;
    font-size: 15px;
    line-height: 1.5;
}
.twitter-detail-content .tweet-avatar-wrap {
    background: #1d9bf0;
    width: 48px !important;
    height: 48px !important;
    flex-shrink: 0;
}
.twitter-detail-content .tweet-avatar-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 详情页通用头像占位 div：无论模型是否写 class，都能正常显示 */
#twitter-detail-content [style*="border-radius: 50%"],
#twitter-detail-content [style*="border-radius:50%"] {
    width: 48px !important;
    height: 48px !important;
    flex-shrink: 0 !important;
}
#twitter-detail-content [style*="border-radius: 50%"] img,
#twitter-detail-content [style*="border-radius:50%"] img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}
#twitter-detail-content .tweet-avatar-wrap,
#twitter-detail-content [class*="avatar"] {
    width: 48px !important;
    height: 48px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border-radius: 50% !important;
}
#twitter-detail-content .tweet-avatar-wrap img,
#twitter-detail-content [class*="avatar"] img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}
.twitter-detail-content .tweet-interactions {
    color: #536471;
}

/* 详情页评论样式：tweet-reply / twitter-x-reply / twitter-comments-section */
#twitter-detail-content .tweet-replies {
    border-top: 1px solid #cdd0d4;
    margin-top: 12px;
    padding-top: 8px;
}
#twitter-detail-content .tweet-reply,
#twitter-detail-content .twitter-x-reply {
    border-top: 1px solid #eff3f4;
    padding: 10px 0;
    color: #0f1419 !important;
}
#twitter-detail-content .twitter-x-reply .tweet-text,
#twitter-detail-content .tweet-reply .tweet-text {
    color: #0f1419 !important;
    font-size: 14px;
    line-height: 1.45;
}
#twitter-detail-content .twitter-x-reply .tweet-name,
#twitter-detail-content .tweet-reply .tweet-name {
    font-size: 14px;
    font-weight: 700;
    color: #000;
}
#twitter-detail-content .twitter-x-reply .tweet-handle,
#twitter-detail-content .tweet-reply .tweet-handle,
#twitter-detail-content .twitter-x-reply .tweet-time,
#twitter-detail-content .tweet-reply .tweet-time {
    font-size: 13px;
    color: #536471;
}
#twitter-detail-content .twitter-x-reply .tweet-avatar-wrap,
#twitter-detail-content .tweet-reply .tweet-avatar-wrap {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
}

/* API 模型偶发在评论头像列写 position:sticky；详情滚动区会令头像钉在视口、与正文分离 */
#twitter-detail-content .tweet-reply > div:first-child,
#twitter-detail-content .twitter-x-reply > div:first-child {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
}

/* 评论区 */
.twitter-comments-section {
    border-top: 1px solid #eff3f4;
    padding-top: 12px;
    margin-top: 8px;
}
.twitter-comments-title {
    font-size: 14px;
    font-weight: 700;
    color: #000;
    margin-bottom: 12px;
}
.twitter-comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.twitter-comment-avatar-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.twitter-comment-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.twitter-comment-body {
    flex: 1;
    min-width: 0;
}
.twitter-comment-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}
.twitter-comment-name {
    font-size: 13px;
    font-weight: 700;
    color: #000;
}
.twitter-comment-handle {
    font-size: 13px;
    color: #536471;
}
.twitter-comment-text {
    font-size: 14px;
    color: #0f1419;
    line-height: 1.45;
}

.twitter-compose-fab {
    position: absolute;
    right: 18px;
    bottom: 92px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #1d9bf0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(29, 155, 240, 0.28);
    cursor: pointer;
    z-index: 12;
}
.twitter-compose-modal-content {
    width: min(92vw, 420px);
}

/* 发推弹窗：标题单行居中；不再使用 .close-btn（全局 .close-btn 为 width:100% 会破坏顶栏布局） */
#twitter-compose-modal .twitter-compose-modal-header {
    justify-content: center;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #eff3f4;
    background: #fff;
}

#twitter-compose-modal .twitter-compose-modal-header h3 {
    flex: 0 1 auto;
    width: 100%;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #0f1419;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

#twitter-compose-modal .modal-footer.twitter-compose-modal-footer {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px 16px;
    border-top: 1px solid #eff3f4;
    height: auto;
    min-height: 0;
    background: #fff;
}

#twitter-compose-modal .modal-footer.twitter-compose-modal-footer .btn-cancel,
#twitter-compose-modal .modal-footer.twitter-compose-modal-footer .btn-confirm {
    flex: 1 1 0;
    min-width: 0;
    min-height: 46px;
    height: auto;
    padding: 12px 16px;
    margin: 0;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-sizing: border-box;
}

#twitter-compose-modal .modal-footer.twitter-compose-modal-footer .btn-cancel {
    background: #fff;
    color: #0f1419;
    border: 1px solid #cfd9de;
}

#twitter-compose-modal .modal-footer.twitter-compose-modal-footer .btn-cancel:hover {
    background: #f7f9fa;
}

#twitter-compose-modal .modal-footer.twitter-compose-modal-footer .btn-confirm {
    background: #1d9bf0;
    color: #fff;
    border: 1px solid #1d9bf0;
}

#twitter-compose-modal .modal-footer.twitter-compose-modal-footer .btn-confirm:hover:not(:disabled) {
    background: #1a8cd8;
    border-color: #1a8cd8;
}

#twitter-compose-modal .modal-footer.twitter-compose-modal-footer .btn-confirm:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.twitter-compose-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.twitter-compose-input {
    min-height: 160px;
    resize: vertical;
}
.twitter-compose-footer {
    display: flex;
    justify-content: flex-end;
}
.twitter-compose-count {
    font-size: 12px;
    color: #536471;
}

.twitter-user-post-card,
.twitter-user-reply-activity {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eff3f4;
    cursor: pointer;
}
.twitter-user-post-avatar,
.twitter-user-post-avatar--ph,
.twitter-user-post-detail-avatar,
.twitter-user-post-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1d9bf0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.twitter-user-post-avatar img,
.twitter-user-post-detail-avatar img,
.twitter-user-post-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.twitter-user-post-main {
    flex: 1;
    min-width: 0;
}
.twitter-user-post-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.twitter-user-post-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f1419;
}
.twitter-user-post-handle {
    font-size: 14px;
    color: #536471;
}
.twitter-user-post-text {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.5;
    color: #0f1419;
    word-break: break-word;
}
.twitter-user-post-meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: #536471;
}
.twitter-user-reply-activity {
    display: block;
}
.twitter-user-reply-label {
    font-size: 12px;
    color: #536471;
    margin-bottom: 6px;
}
.twitter-user-reply-text {
    font-size: 14px;
    color: #0f1419;
    line-height: 1.45;
}
.twitter-user-reply-origin {
    margin-top: 6px;
    font-size: 12px;
    color: #536471;
}
.twitter-user-post-detail-empty {
    padding: 16px 0;
    font-size: 14px;
    color: #536471;
}
.twitter-user-post-comment-replyto {
    margin-top: 3px;
    font-size: 12px;
    color: #536471;
}

/* 主屏幕可滚动区域：小屏时允许滚动，避免内容被截断 */
.home-scroll-wrapper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* 为底部导航留出空间，避免内容被遮挡 */
    padding-bottom: 90px;
    /* 隐藏滚动条，保持视觉美观，滚动功能正常 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

/* 系统页面样式 */
#system-page {
    background: #f5f5f5;
}

/* 系统头部样式 */
.system-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(247, 247, 247, 0.55);
    background-color: rgba(247, 247, 247, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

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

.system-header-buttons {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

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

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

/* 返回箭头样式 */
.back-arrow {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    display: inline-block;
    line-height: 1;
}

/* 系统内容样式 */
.system-content {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
}

/* 添加系统命令模态框样式 */
.add-command-modal {
    width: 500px;
    height: 400px;
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

.add-command-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.add-command-modal .modal-header h3 {
    text-align: center;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    width: 100%;
    transform: translateX(-8px);
}

.add-command-modal .modal-header .modal-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.command-name-group {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.command-name-group label {
    width: 80px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-right: 12px;
}

.command-name-group .form-input {
    flex: 1;
}

.command-content-group {
    margin-bottom: 16px;
}

.command-content-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.resizeable-input {
    position: relative;
    width: 100%;
}

.resizeable-textarea {
    width: 100%;
    height: 120px;
    min-height: 120px;
    max-height: 200px;
    resize: none;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #e0e0e0;
    cursor: nwse-resize;
    border-bottom-right-radius: 8px;
}

.add-command-modal .modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.add-command-footer {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.btn-cancel, .btn-save {
    padding: 0;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 140px;
    height: 48px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cancel {
    background: white;
    color: #333;
    border-right: 1px solid #f7f7f7;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-save {
    background: black;
    color: white;
}

.btn-save:hover {
    background: #333;
}

/* 指令列表样式 */
.command-hint {
    font-size: 12px;
    color: #999;
    padding: 2px 16px 8px;
}

.command-list {
    padding: 8px 0;
}

.command-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.command-item-tappable {
    cursor: pointer;
}

.command-item-tappable:hover {
    background-color: #f9f9f9;
}

.command-item:last-child {
    border-bottom: none;
}

.command-info {
    flex: 1;
}

.command-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.command-status {
    font-size: 12px;
    color: #999;
}

.command-status.active {
    color: #07C160;
}

.command-actions {
    display: flex;
    gap: 8px;
}

.command-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.command-btn.activate {
    background: #07C160;
    color: white;
}

.command-btn.deactivate {
    background: #f0f0f0;
    color: #333;
}

.command-btn.delete {
    background: #ff4d4f;
    color: white;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.system-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.system-section h2 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.system-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.system-item:hover {
    background-color: #f9f9f9;
}

.system-item:last-child {
    border-bottom: none;
}

.system-item span {
    font-size: 16px;
    color: #333;
}

.system-item-arrow {
    font-size: 14px;
    color: #999;
}

/* 磨砂玻璃效果 */
.system-header {
    background: rgba(247, 247, 247, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 状态栏样式 */
.status-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.status-left {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-right: auto;
}

.status-right {
    display: flex;
    gap: 12px;
    font-size: 14px;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.status-icon {
    display: inline-block;
    color: #666;
    transition: color 0.3s ease;
}

/* 线性状态栏图标（SVG），使用 currentColor 适配所有界面背景 */
.status-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
    color: rgba(0, 0, 0, 0.55);
    opacity: 0.95;
}

/* 在浅色磨砂栏上更柔和；在照片封面等复杂背景上依赖 shadow 提升可读性 */
.status-icon {
    filter: none;
}

/* 电池图标样式 */
/* 兼容旧结构：如仍存在 battery-icon/battery-img，不再强制白底 */
.battery-icon::after { background: transparent; }

/* 主卡片样式 */
.main-card {
    position: relative;
    margin: 18px 16px 20px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* 底层：透明玻璃效果 */
.card-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-background:hover {
    opacity: 0.8;
}

/* 中间层：磨砂玻璃效果（35% 白色遮罩，便于透出主卡片背景图） */
.card-content {
    position: relative;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    padding: 8px 24px;
    z-index: 1;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 头像区域 */
.avatar-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 16px;
    z-index: 2;
}

/* 头像下方：装饰图标 + 签名 + 地理位置，统一宽度与纵向节奏 */
.card-meta-below-avatar {
    align-self: stretch;
    width: 100%;
    max-width: 288px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    z-index: 1;
    position: relative;
}

/* 圆形头像框 */
.avatar-frame {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    cursor: pointer;
    transition: border-color 0.2s;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 鼠标悬停时边框变深 */
.avatar-frame:hover {
    border-color: #999;
}

/* 头像图片 */
.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 6;
    pointer-events: none;
}

/* 头像文件输入框 */
.avatar-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

/* 上传覆盖层 */
.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
    border-radius: 20px;
}

.card-background:hover .upload-overlay {
    opacity: 1;
}

.upload-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
}



/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 20px;
    display: none;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #07C160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.decorative-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    gap: 6px 10px;
    width: 100%;
    margin: 0;
    z-index: 1;
    position: relative;
    box-sizing: border-box;
}

.decorative-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.85em;
    height: 1.85em;
    font-size: 16px;
    line-height: 1;
    color: #555;
    opacity: 0.82;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
    font-variant-numeric: tabular-nums;
}

.decorative-icon:hover {
    transform: scale(1.12);
    opacity: 1;
    color: #333;
}

.card-signature {
    text-align: center;
    margin: 0;
    width: 100%;
    z-index: 1;
    position: relative;
    box-sizing: border-box;
    padding: 0 2px;
}

.card-signature p {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    margin: 0;
    font-style: italic;
    line-height: 1.45;
    letter-spacing: 0.02em;
    width: 100%;
    max-width: 100%;
    text-align: center;
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: break-word;
}

.card-location {
    text-align: center;
    margin: 0;
    width: 100%;
    z-index: 1;
    position: relative;
    box-sizing: border-box;
    padding: 0 2px;
}

.card-location span {
    display: inline-block;
    font-size: 14px;
    color: #555;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.01em;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    vertical-align: middle;
}

/* 放入统一容器后不再重复外边距（间距由 .card-meta-below-avatar gap 控制） */
.card-meta-below-avatar .decorative-icons,
.card-meta-below-avatar .card-signature,
.card-meta-below-avatar .card-location {
    margin-top: 0;
    margin-bottom: 0;
}

/* 主屏幕内容区 */
.home-content {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 16px 100px;
    gap: 20px;
}

/* 左侧区域 */
.left-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 0 0 auto;
    /* 与右侧音乐卡片顶部对齐时的视觉微调 */
    padding-top: 0;
}

/* 右侧区域 */
.right-section {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    min-width: 0;
}

/* 主界面音乐播放器 - 简约黑白灰风格 */
.music-player-card {
    width: 100%;
    max-width: 240px;
    min-width: 160px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 14px;
    padding: 12px;
    /* 交由 .home-content 的 padding/gap 控制边距，避免与左列顶部不齐 */
    margin: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.music-upload-input { display: none; }

.music-album-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(145deg, #e8e8e8 0%, #d0d0d0 100%);
    cursor: pointer;
    position: relative;
}

.music-album-art {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.music-album-placeholder {
    font-size: 36px;
    color: rgba(0, 0, 0, 0.25);
}

.music-upload-hint {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.4);
    margin-top: 4px;
}

.music-album-art.has-cover .music-album-placeholder,
.music-album-art.has-cover .music-upload-hint {
    display: none;
}

.music-track-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 6px;
}

.music-track-meta {
    flex: 1;
    min-width: 0;
}

.music-title, .music-artist {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.music-artist {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.music-volume-wrap {
    flex-shrink: 0;
    position: relative;
}

.music-volume-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.music-volume-panel {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.music-volume-panel.show {
    display: block;
}

.music-volume-slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
    outline: none;
}

.music-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #1a1a1a;
    border-radius: 50%;
    cursor: pointer;
}

.music-progress {
    margin-top: 8px;
}

.music-progress-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.music-progress-fill {
    height: 100%;
    background: #1a1a1a;
    border-radius: 2px;
    width: 0%;
}

.music-progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #1a1a1a;
    border-radius: 50%;
    left: 0%;
}

.music-time {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
    margin-top: 4px;
}

.music-controls {
    display: grid;
    /* 两排布局：上排仅播放键；下排 4 个控制键。列宽=按钮宽度，整体更收拢 */
    grid-template-columns: repeat(4, var(--music-btn-size));
    justify-items: center;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    column-gap: clamp(6px, 2vw, 10px);
    row-gap: clamp(8px, 2.4vw, 10px);
    max-width: 100%;
    padding: 2px 0 0;
    box-sizing: border-box;
    /* 两排布局：按钮随屏幕等比例缩放 */
    --music-btn-size: clamp(30px, 7.6vw, 38px);
    --music-btn-font: clamp(14px, 3.4vw, 16px);
    --music-play-size: clamp(36px, 9.2vw, 44px);
    --music-play-font: clamp(16px, 3.9vw, 18px);
}

/* 两排居中：
   第1排：播放(3) 独占居中
   第2排：添加(1) / 上一曲(2) / 下一曲(4) / 随机(5)
*/
.music-controls > .music-ctrl-btn:nth-child(3) {
    grid-row: 1;
    grid-column: 1 / -1;
    justify-self: center;
}
.music-controls > .music-ctrl-btn:nth-child(1) { grid-row: 2; grid-column: 1; }
.music-controls > .music-ctrl-btn:nth-child(2) { grid-row: 2; grid-column: 2; }
.music-controls > .music-ctrl-btn:nth-child(4) { grid-row: 2; grid-column: 3; }
.music-controls > .music-ctrl-btn:nth-child(5) { grid-row: 2; grid-column: 4; }

.music-ctrl-btn {
    width: var(--music-btn-size);
    height: var(--music-btn-size);
    border: none;
    background: none;
    font-size: var(--music-btn-font);
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.music-ctrl-btn:hover { background: rgba(0, 0, 0, 0.06); }

.music-ctrl-btn.active {
    color: #1a1a1a;
    font-weight: 600;
}

.music-add-btn,
.music-repeat-btn {
    /* 与上一曲/下一曲同尺寸，字更粗一点 */
    font-weight: 700;
}

.music-play-btn {
    width: var(--music-play-size);
    height: var(--music-play-size);
    background: #1a1a1a;
    color: #fff;
    font-size: var(--music-play-font);
}

.music-play-btn:hover { background: #333; }

/* 播放列表模态框 */
.music-playlist-modal .music-playlist-content {
    max-width: 320px;
    width: 90%;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.music-playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.music-playlist-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.music-playlist-close {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
}

.music-playlist-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.music-playlist-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 120px;
}

.music-playlist-empty {
    padding: 24px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.music-playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.music-playlist-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.music-playlist-item.active {
    background: rgba(0, 0, 0, 0.06);
    font-weight: 500;
}

.music-playlist-item-index {
    width: 24px;
    font-size: 12px;
    color: #999;
}

.music-playlist-item-info {
    flex: 1;
    min-width: 0;
}

.music-playlist-item-title {
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-playlist-item-artist {
    font-size: 12px;
    color: #999;
}

.music-playlist-item-missing .music-playlist-item-title {
    color: #999;
}

.music-playlist-item-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: #666;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
}

.music-playlist-item-delete:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.music-playlist-footer {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.music-playlist-add-btn,
.music-playlist-cancel-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.music-playlist-add-btn {
    background: #1a1a1a;
    color: #fff;
}

.music-playlist-add-btn:hover {
    background: #333;
}

.music-playlist-cancel-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

.music-playlist-cancel-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 小屏音乐播放器适配 */
@media (max-width: 375px), (max-height: 600px) {
    .music-player-card { max-width: 200px; min-width: 140px; padding: 10px; margin: 10px; }
    .music-title { font-size: 12px; }
    .music-artist { font-size: 10px; }
    /* 小屏更紧凑的两排间距 */
    .music-controls { column-gap: 8px; row-gap: 8px; }
}

/* 超窄屏（PWA 桌面小窗 / 极窄浏览器）进一步收紧 */
@media (max-width: 340px) {
    .music-controls {
        column-gap: 6px;
        row-gap: 8px;
        --music-btn-size: clamp(26px, 8.6vw, 32px);
        --music-play-size: clamp(32px, 10.4vw, 38px);
    }
}

/* 日期显示模块 */
.date-clock {
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.clock {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.clock-face {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clock-number {
    position: absolute;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.clock-12 {
    top: 10px;
}

.clock-3 {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.clock-6 {
    bottom: 10px;
}

.clock-9 {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.clock-center {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff6b6b;
    z-index: 10;
}

.clock-hand {
    position: absolute;
    background: #333;
    transform-origin: bottom center;
    border-radius: 2px;
}

.hour-hand {
    width: 3px;
    height: 26px;
    top: 29px;
    background: #333;
    z-index: 5;
}

.minute-hand {
    width: 2px;
    height: 40px;
    top: 15px;
    background: #666;
    z-index: 6;
}

.second-hand {
    width: 1px;
    height: 44px;
    top: 11px;
    background: #ff6b6b;
    z-index: 7;
}

.clock-day {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
}

/* 快捷功能 */
.quick-functions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 160px;
}

.function-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    width: 74px;
    height: 74px;
}

.function-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.function-icon {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.function-icon img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.function-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    margin-top: 4px;
    text-align: center;
}

/* 底部导航 */
.bottom-nav {
    position: absolute;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    right: auto;
    width: 360px;
    max-width: calc(100% - 28px);
    transform: translateX(-50%);
    box-sizing: border-box;
    display: flex;
    justify-content: space-around;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 6px 6px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    flex: 1;
    max-width: 72px;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.nav-icon {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.nav-icon img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.nav-item:hover .nav-icon {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-name {
    font-size: 10px;
    font-weight: 500;
    color: #666;
    transition: color 0.3s ease;
}

.nav-item:hover .nav-name {
    color: #999;
}

/* 主界面底部「系统」入口锁定态 */
.nav-item.nav-item--locked {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.4);
}
.nav-item.nav-item--locked:hover {
    background-color: transparent;
    transform: none;
}
.nav-item.nav-item--locked:hover .nav-icon {
    background: rgba(255, 255, 255, 0.8);
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.nav-item.nav-item--locked:hover .nav-name {
    color: #666;
}

/* 模态框样式 */
/* 设置页面样式 */
#settings-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.settings-content {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.settings-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.back-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

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

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

/* 世界书页面样式 */
#books-page {
    background: linear-gradient(180deg, #f7f5f0 0%, #f3f0ea 100%);
}

.books-header {
    display: flex;
    align-items: center;
    padding: 14px 16px 12px;
    background: rgba(250, 248, 243, 0.94);
    border-bottom: 1px solid rgba(129, 116, 96, 0.12);
    position: relative;
    backdrop-filter: blur(12px);
}

.books-header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #3e352d;
    flex: 1;
    text-align: center;
    margin: 0;
}

.books-header-buttons {
    display: flex;
    gap: 8px;
    position: absolute;
    right: 16px;
}

.books-header-btn {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(129, 116, 96, 0.12);
    font-size: 18px;
    color: #5c5147;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.books-header-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 12px;
}

.books-header-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.books-header-primary-btn {
    background: #8f7b67;
    color: #fffdf9;
    border-color: transparent;
}

.books-header-btn:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(129, 116, 96, 0.22);
    transform: translateY(-1px);
}

.books-header-primary-btn:hover {
    background: #816f5d;
}

.books-header-btn.world-book-select-mode-on {
    background: rgba(143, 123, 103, 0.16);
    color: #6e5d4d;
    border-color: rgba(143, 123, 103, 0.3);
}

.books-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 24px;
    position: relative;
    box-sizing: border-box;
}

.books-content.world-book-delete-mode {
    padding-bottom: 88px;
}

.world-book-delete-fab {
    position: absolute;
    right: 16px;
    bottom: 18px;
    z-index: 4;
    padding: 12px 20px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fffdf9;
    background: #b76464;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(130, 84, 84, 0.22);
}

.world-book-delete-fab:hover {
    background: #a95555;
}

.world-book-delete-fab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.world-book-item.world-book-item-multi {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.world-book-item.world-book-item-multi .world-book-item-cb {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #8f7b67;
}

.world-book-item.world-book-item-multi.checked {
    border: 1px solid rgba(143, 123, 103, 0.45);
    background: rgba(143, 123, 103, 0.08);
}

.world-book-item.world-book-item-multi .world-book-item-text {
    flex: 1;
    min-width: 0;
}

.world-book-list {
    display: none;
}

.world-book-list.has-items {
    display: block;
}

.world-book-empty.has-items {
    display: none;
}

.world-book-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100% - 24px);
    padding: 56px 28px;
    text-align: center;
    background: rgba(255, 252, 246, 0.72);
    border: 1px solid rgba(129, 116, 96, 0.1);
    border-radius: 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.world-book-empty-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: rgba(143, 123, 103, 0.1);
    color: #8f7b67;
    font-size: 28px;
}

.world-book-empty-text {
    font-size: 17px;
    font-weight: 600;
    color: #4b4138;
    margin-bottom: 8px;
}

.world-book-empty-hint {
    font-size: 13px;
    line-height: 1.7;
    color: #8b7d70;
    max-width: 220px;
}

.world-book-item {
    background: rgba(255, 252, 248, 0.92);
    border: 1px solid rgba(129, 116, 96, 0.1);
    border-radius: 16px;
    padding: 15px 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(97, 79, 57, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.world-book-item:hover {
    background: #fffdfa;
    border-color: rgba(129, 116, 96, 0.18);
    transform: translateY(-1px);
}

.world-book-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #40352d;
    margin-bottom: 6px;
}

.world-book-item-preview {
    font-size: 13px;
    color: #87796c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-book-folder-section {
    margin-bottom: 18px;
}

.world-book-folder-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin: 0 0 10px;
    border: 1px solid rgba(129, 116, 96, 0.1);
    border-radius: 14px;
    background: rgba(255, 252, 248, 0.74);
    color: #6a5d51;
    cursor: pointer;
}

.world-book-folder-header-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.world-book-folder-arrow {
    width: 10px;
    height: 10px;
    border-right: 2.4px solid currentColor;
    border-bottom: 2.4px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -2px;
}

.world-book-folder-section.expanded .world-book-folder-arrow {
    transform: rotate(135deg);
    margin-top: 2px;
}

.world-book-folder-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #8b7b6b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.world-book-folder-count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(143, 123, 103, 0.12);
    color: #7b6b5b;
    font-size: 12px;
    font-weight: 600;
}

.world-book-folder-items {
    padding: 0 2px;
}

.world-book-select-list .world-book-item {
    margin-bottom: 8px;
}

.world-book-select-list .world-book-item.selected {
    border: 2px solid #07c160;
}

/* 好友设置-选择世界书：分组折叠列表 */
.world-book-select-modal-content {
    max-width: 360px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.world-book-select-modal-content .modal-header {
    position: relative;
}

.world-book-select-modal-content .modal-close {
    display: flex;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.world-book-select-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
}

.world-book-select-folder {
    margin-bottom: 8px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.world-book-select-folder-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.world-book-select-folder-header:hover {
    background: #eee;
}

.world-book-select-folder-header::before {
    content: '▶';
    font-size: 10px;
    margin-right: 8px;
    transition: transform 0.2s;
}

.world-book-select-folder.expanded .world-book-select-folder-header::before {
    transform: rotate(90deg);
}

.world-book-select-folder-entries {
    display: none;
    padding: 0 8px 8px;
}

.world-book-select-folder.expanded .world-book-select-folder-entries {
    display: block;
}

.world-book-select-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-top: 4px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

.world-book-select-item:hover {
    background: #fafafa;
}

.world-book-select-item.checked {
    border-color: #07c160;
    background: rgba(7, 193, 96, 0.06);
}

.world-book-select-item input[type="checkbox"] {
    margin-right: 10px;
    flex-shrink: 0;
}

.world-book-select-footer {
    padding-top: 12px;
    border-top: 1px solid #eee;
    margin-top: 12px;
}

.world-book-select-confirm-btn {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

.world-book-select-confirm-btn:hover {
    background: #333;
}

/* 选择世界书模态框：置于 body 下，确保显示在好友设置界面之上 */
.modal-over-friend-settings,
#select-world-book-modal {
    z-index: 99999;
    position: fixed;
}

.world-book-textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.7;
}

.add-world-book-modal-content {
    max-width: 440px;
}

.world-book-modal-card {
    border: 1px solid rgba(129, 116, 96, 0.12);
    border-radius: 24px;
    background: linear-gradient(180deg, #fdfbf7 0%, #f7f3ed 100%);
    box-shadow: 0 18px 48px rgba(77, 63, 49, 0.16);
    overflow: hidden;
}

.world-book-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(129, 116, 96, 0.12);
    background: rgba(255, 252, 247, 0.8);
}

.world-book-modal-header h3,
.new-folder-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #40352d;
}

.world-book-modal-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(129, 116, 96, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #6e6052;
    cursor: pointer;
    transition: all 0.2s ease;
}

.world-book-modal-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.world-book-modal-close:hover {
    background: #fffdfa;
    border-color: rgba(129, 116, 96, 0.24);
}

.world-book-modal-body {
    padding: 18px 20px 10px;
}

.world-book-form-group {
    margin-bottom: 16px;
}

.world-book-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #5f5348;
}

.world-book-form-input,
.world-book-folder-select,
.new-folder-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(129, 116, 96, 0.14);
    border-radius: 14px;
    font-size: 14px;
    color: #40352d;
    background: rgba(255, 255, 255, 0.76);
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.world-book-form-input::placeholder,
.new-folder-input::placeholder {
    color: #a19387;
}

.world-book-form-input:focus,
.world-book-folder-select:focus,
.new-folder-input:focus {
    outline: none;
    border-color: rgba(143, 123, 103, 0.5);
    box-shadow: 0 0 0 4px rgba(143, 123, 103, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.world-book-folder-select {
    appearance: none;
}

.world-book-form-hint,
.form-hint {
    font-size: 12px;
    color: #8b7d70;
    margin-top: 7px;
    line-height: 1.6;
}

.world-book-modal-footer,
.new-folder-buttons {
    display: flex;
    gap: 12px;
    padding: 14px 20px 20px;
    border-top: none;
    height: auto;
}

.world-book-action-btn,
.new-folder-btn {
    flex: 1;
    min-height: 44px;
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.world-book-action-secondary {
    background: rgba(255, 255, 255, 0.78);
    color: #5f5348;
    border-color: rgba(129, 116, 96, 0.14);
}

.world-book-action-secondary:hover {
    background: #fffdfa;
    border-color: rgba(129, 116, 96, 0.24);
}

.world-book-action-primary {
    background: #8f7b67;
    color: #fffdf9;
    box-shadow: 0 10px 20px rgba(111, 93, 75, 0.18);
}

.world-book-action-primary:hover {
    background: #816f5d;
}

#add-world-book-modal .modal-close,
#new-folder-modal .modal-close {
    display: none;
}

#new-folder-modal .modal-content.new-folder-modal-content {
    border: 1px solid rgba(129, 116, 96, 0.12);
    box-shadow: 0 18px 48px rgba(77, 63, 49, 0.16);
}

.new-folder-modal-content {
    max-width: 360px;
    padding: 0;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.world-book-folder-modal-body {
    padding: 18px 20px 6px;
}


.new-folder-btn.cancel {
    background: rgba(255, 255, 255, 0.78);
    color: #5f5348;
    border: 1px solid rgba(129, 116, 96, 0.14);
}

.new-folder-btn.cancel:hover {
    background: #fffdfa;
    border-color: rgba(129, 116, 96, 0.24);
}

.new-folder-btn.create {
    background: #8f7b67;
    color: #fffdf9;
    box-shadow: 0 10px 20px rgba(111, 93, 75, 0.18);
}

.new-folder-btn.create:hover {
    background: #816f5d;
}

.world-book-delete-confirm-modal-content .world-book-delete-confirm-text {
    font-size: 14px;
    color: #555;
    line-height: 1.55;
    margin: 0 0 4px;
    text-align: center;
}

.new-folder-btn.world-book-delete-confirm-danger {
    background: #e64a4a;
    color: #fff;
}

.new-folder-btn.world-book-delete-confirm-danger:hover {
    background: #d43c3c;
}

/* 世界书分组列表 */
.world-book-folder-list-modal-content {
    max-width: 380px;
}

.world-book-folder-list-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.world-book-folder-list-add-btn {
    border: none;
    background: rgba(129, 111, 93, 0.12);
    color: #7b6651;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.world-book-folder-list-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 2px 2px;
    max-height: 360px;
    overflow-y: auto;
}

.world-book-folder-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(129, 111, 93, 0.12);
}

.world-book-folder-list-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #5c4a3b;
    word-break: break-all;
}

.world-book-folder-list-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.world-book-folder-list-action-btn {
    border: none;
    background: transparent;
    color: #7b6651;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
}

.world-book-folder-list-action-danger {
    color: #d14a4a;
}

.world-book-folder-list-empty {
    text-align: center;
    color: #8f7c69;
    font-size: 14px;
    padding: 28px 12px;
}

.world-book-folder-section {
    margin-bottom: 20px;
}

.world-book-folder-header {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    padding: 8px 0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.world-book-folder-header::before {
    content: '📁';
}

.settings-group {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.setting-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    padding: 12px 16px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-buttons {
    display: flex;
    gap: 12px;
    padding: 0 16px 12px;
    flex-wrap: wrap;
}

.preset-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
    padding: 8px 12px;
    background: rgba(245, 245, 245, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: rgba(235, 235, 235, 0.8);
    transform: translateY(-1px);
}

.preset-btn-danger {
    color: #c0392b;
    border-color: rgba(192, 57, 43, 0.25);
}

.api-settings-hint {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    padding: 0 16px 12px;
    margin: 0;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
    flex-wrap: wrap;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.setting-item.with-arrow {
    justify-content: space-between;
    cursor: pointer;
}

.setting-item.with-toggle {
    justify-content: space-between;
}

/* 设置 · 主动发消息展开区 */
.auto-message-detail-panel {
    padding: 8px 14px 14px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.auto-message-detail-panel .setting-item.with-toggle {
    margin-top: 8px;
}

.auto-message-detail-panel .setting-item.with-arrow {
    margin-top: 4px;
    border-bottom: none;
}

.auto-message-subfield {
    margin-bottom: 12px;
}

.auto-message-sub-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.auto-message-number-input {
    width: 100%;
    max-width: 120px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.auto-message-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.auto-message-time-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
}

.auto-message-time-sep {
    font-size: 14px;
    color: #666;
}

.auto-message-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #888;
    line-height: 1.45;
}

.auto-message-candidates-summary {
    margin: -4px 14px 10px;
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

.auto-message-detail-panel #auto-message-api-settings-row.setting-item.with-arrow {
    margin-top: 4px;
}

.proactive-auto-api-intro {
    margin: 0 0 12px;
}

/* 主动发消息候选人弹窗 */
#proactive-candidates-modal {
    z-index: 1200;
}

.setting-item.with-value {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.setting-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-item.with-value .setting-label {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item.vertical-layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.setting-item.vertical-layout .setting-label {
    width: 100%;
    flex: none;
}

.setting-item.vertical-layout .api-key-container,
.setting-item.vertical-layout .setting-input {
    width: 100%;
}

.model-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.model-name-row .setting-label {
    font-size: 16px;
    margin-right: 10px;
    margin-left: 11px;
    white-space: nowrap;
}

.model-select-container {
    position: relative;
    flex: 1;
}

.model-select-container .setting-input {
    font-size: 14px;
    padding: 10px 30px 10px 12px;
    width: calc(100% + 10px);
    border: 1px solid transparent;
    background-color: transparent;
    transition: all 0.3s ease;
}

.model-select-container .setting-input:hover {
    border-color: rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.8);
}

.model-select-container .setting-input:focus {
    outline: none;
    border-color: #07C160;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.model-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    font-size: 12px;
}

.setting-label {
    font-size: 16px;
    color: #333;
    flex: 0 0 100px;
}

.setting-select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    z-index: 1000;
}

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

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

.setting-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    width: 100%;
}

.setting-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.api-key-container {
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.api-key-container .setting-input {
    flex: 1;
    padding-right: 40px;
}

.api-key-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 1;
}

.api-key-clear:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.setting-select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.fetch-models-btn {
    width: calc(100% - 32px);
    margin: 12px 16px;
    padding: 12px;
    background: rgba(245, 245, 245, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fetch-models-btn:hover:not(:disabled) {
    background: rgba(235, 235, 235, 0.8);
    transform: translateY(-1px);
}

.fetch-models-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fetch-icon {
    font-size: 16px;
}

.setting-value {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.setting-number {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: transparent;
    text-align: right;
    transition: all 0.3s ease;
}

.setting-number:hover {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.setting-number:focus {
    outline: none;
    border-color: #07C160;
    background: white;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.setting-description {
    width: 100%;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    padding-left: 0;
}

.save-all-btn {
    width: calc(100% - 32px);
    margin: 24px 16px 16px;
    padding: 16px;
    background: #000;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-all-btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 克隆音色设置 - 连接测试区域样式 */
.connection-test-group {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 12px;
    background: rgba(245, 245, 245, 0.8);
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.connection-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s ease;
}

.connection-status.status-success .status-dot.success {
    background: #07C160;
    box-shadow: 0 0 8px rgba(7, 193, 96, 0.4);
}

.connection-status.status-error .status-dot.error {
    background: #FF4D4F;
    box-shadow: 0 0 8px rgba(255, 77, 79, 0.4);
}

.connection-status.status-testing .status-dot.testing {
    background: #1890FF;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.connection-status.status-success {
    background: rgba(7, 193, 96, 0.1);
    color: #07C160;
}

.connection-status.status-error {
    background: rgba(255, 77, 79, 0.1);
    color: #FF4D4F;
}

.connection-status.status-testing {
    background: rgba(24, 144, 255, 0.1);
    color: #1890FF;
}

.test-connection-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-connection-btn:hover {
    background: rgba(245, 245, 245, 0.9);
    border-color: rgba(0, 0, 0, 0.2);
}

.save-settings-group {
    margin-top: 16px;
    padding: 0 16px;
}

.save-settings-group .save-all-btn {
    width: 100%;
    margin: 0;
}

/* 语音模型下拉框样式统一 */
.setting-input.setting-select {
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* 开关控件样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e0e0e0;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4cd964;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 确保模态框在小手机屏幕内居中 */
#edit-profile-modal {
    position: absolute;
    z-index: 1001;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

#edit-profile-modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 24px;
    border: 1px solid #888;
    border-radius: 12px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-header .back-btn {
    position: static;
    transform: none;
    margin: 0;
    padding: 4px;
    width: 36px;
    height: 36px;
}

.modal-close {
    display: none;
}

/* 保存预设模态框样式 */
.preset-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin: 20px 0;
    box-sizing: border-box;
}

.preset-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 0;
}

.modal-buttons button {
    flex: 1;
    padding: 16px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-buttons .cancel-btn {
    background: #f5f5f5;
    color: #333;
}

.modal-buttons .cancel-btn:hover {
    background: #e5e5e5;
}

.modal-buttons .save-btn {
    background: #07C160;
    color: white;
}

.modal-buttons .save-btn:hover {
    background: #05a850;
}

/* 选择预设模态框样式 */
.preset-list {
    max-height: 200px;
    overflow-y: auto;
}

.preset-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.preset-item:last-child {
    border-bottom: none;
}

.preset-item.active {
    background-color: #e8f5e8;
    border-left: 4px solid #07C160;
}

.preset-item-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 !important;
    cursor: default;
}

.preset-item-row:hover {
    background-color: #f9f9f9;
}

.preset-item-name-btn {
    flex: 1;
    margin: 0;
    padding: 16px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
}

.preset-item-name-btn:active {
    background: rgba(7, 193, 96, 0.08);
}

.preset-item-delete-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 16px 14px;
    border: none;
    border-left: 1px solid #eee;
    background: #fff8f8;
    color: #c0352b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.preset-item-delete-btn:active {
    background: #ffe8e6;
}

/* 聊天 · 内置拍摄 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chat-camera-modal .chat-camera-modal-content {
    width: 92%;
    max-width: 340px;
    margin: 0 auto;
    padding: 16px 12px 20px;
    border-radius: 20px;
    background: linear-gradient(165deg, #e8f5ef 0%, #f2faf6 45%, #fdf6fa 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(7, 193, 96, 0.25);
}

.chat-camera-stage {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.chat-camera-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 18px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.chat-camera-video {
    position: absolute;
    left: 13%;
    top: 20%;
    width: 74%;
    height: 58%;
    object-fit: cover;
    border-radius: 14px;
    /* 必须高于装饰框：chat-camera-frame.png 中部为不透明白底，否则会完全挡住镜头画面 */
    z-index: 2;
}

.chat-camera-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
    filter: saturate(1.05) hue-rotate(-4deg) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.chat-camera-hint {
    margin: 14px 4px 10px;
    text-align: center;
    font-size: 13px;
    color: #5a6b62;
    line-height: 1.45;
    min-height: 2.6em;
}

.chat-camera-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px 0;
}

.chat-camera-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
}

.chat-camera-btn-secondary {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    color: #2d4a3e;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.18);
    border: 1px solid rgba(255, 182, 193, 0.65);
}

.chat-camera-btn-secondary:active {
    transform: scale(0.96);
}

.chat-camera-btn-shutter {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    flex-shrink: 0;
    background: radial-gradient(circle at 35% 30%, #fff 0%, #ffb7c5 28%, #ff8fab 55%, #e84d6b 100%);
    box-shadow: 0 4px 14px rgba(232, 77, 107, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.55);
    border: 3px solid #fff;
}

.chat-camera-btn-shutter:active {
    transform: scale(0.92);
    opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
    .chat-camera-btn {
        transition: none;
    }
}

.close-btn {
    width: 100%;
    padding: 16px;
    border: none;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-top: 1px solid #f0f0f0;
}

.close-btn:hover {
    background: #e5e5e5;
}

/* 选择预设模态框样式 */
#select-preset-modal .modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 0;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

#select-preset-modal .btn-cancel {
    width: 100%;
    padding: 16px;
    border: none;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0;
    border-radius: 0;
}

/* 添加好友模态框样式 */
.add-friend-modal {
    width: 90%;
    max-width: 400px;
}

.add-friend-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
}

.add-friend-modal .modal-header h3 {
    flex: 1;
    text-align: center;
    margin: 0;
}

.avatar-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.add-friend-persona-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #07C160;
    cursor: pointer;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.avatar-placeholder:hover {
    border-color: #07C160;
}

.avatar-plus {
    font-size: 32px;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.avatar-placeholder:hover .avatar-plus {
    color: #07C160;
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

/* 可调整大小的输入框样式 */
.resizeable-input {
    position: relative;
}

.resizeable-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    min-width: 100%;
    max-width: 100%;
    resize: none;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
    overflow-y: auto;
}

.resizeable-textarea:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.resize-handle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    cursor: nwse-resize;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23999" d="M10 0v10H0V0h10z M8 8v2H2V2h2V0H0v12h12V8H8z"/></svg>') no-repeat center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.resize-handle:hover {
    opacity: 1;
}

.add-friend-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.btn-add,
.btn-cancel {
    width: 135px;
    height: 45px;
    padding: 0;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add {
    background: #000;
    color: white;
}

.btn-add:hover {
    background: #333;
}

.btn-cancel {
    border: 1px solid #e0e0e0;
    background: white;
    color: #333;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.modal-close {
    display: none;
}

.modal-body {
    padding: 16px;
}

/* 保存预设模态框 */
#save-preset-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

#save-preset-modal.show {
    display: flex;
}

#save-preset-modal .modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#save-preset-modal .modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

#save-preset-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#save-preset-modal .modal-close {
    display: none;
}

#save-preset-modal .form-group {
    margin-bottom: 20px;
}

#save-preset-modal .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

#save-preset-modal .form-group input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

#save-preset-modal .error-message {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 4px;
}

#save-preset-modal .modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

#save-preset-modal .btn-cancel {
    flex: 1;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f5f5f5;
    color: #333;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#save-preset-modal .btn-cancel:hover {
    background-color: #e5e5e5;
}

#save-preset-modal .btn-save {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 4px;
    background-color: #07C160;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#save-preset-modal .btn-save:hover {
    background-color: #05a850;
}

/* 预设选择容器 */
.preset-select-container {
    margin-right: 10px;
}

.preset-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

/* API输入容器 */
.api-input-container {
    width: 100%;
}

/* 模型选择容器 */
.model-select-container {
    position: relative;
    width: 100%;
}

.model-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

/* 模型列表 */
.models-list {
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
}

.model-item {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.model-item:last-child {
    border-bottom: none;
}

/* 连接状态 */
.connection-status {
    display: flex;
    align-items: center;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    /* 未连接或未校验时须有可见占位，避免出现「只剩文字没有圆点」 */
    background-color: #bfbfbf;
    flex-shrink: 0;
}

.status-indicator.connecting {
    background-color: #faad14;
    animation: pulse 1.5s infinite;
}

.status-indicator.connected {
    background-color: #52c41a;
}

.status-indicator.error {
    background-color: #ff4d4f;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: none;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.modal-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.modal-input-textarea {
    min-height: 88px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
}

.error-message {
    font-size: 12px;
    color: #ff4d4f;
    margin-top: 8px;
    min-height: 16px;
}

.modal-footer {
    display: flex;
    padding: 0;
    border-top: 1px solid #f0f0f0;
    height: 50px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background-color: #f5f5f5;
    color: #333;
    border-right: 1px solid #e0e0e0;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

.save-btn {
    background-color: #07C160;
    color: white;
}

.save-btn:hover {
    background-color: #06b155;
}

/* 编辑个人资料模态框 */
.edit-profile-modal {
    width: 320px;
    height: 400px;
    background: rgba(240, 240, 242, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

.edit-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
}

.edit-profile-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.edit-profile-body {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* 头像上传区域 */
.avatar-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar-container {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

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

.avatar-upload-hint {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 昵称编辑区域 */
.nickname-edit-section {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nickname-edit-section label {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.nickname-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.nickname-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

/* 底部按钮区域 */
.edit-profile-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
}

.cancel-btn, .save-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #f5f5f5;
    color: #333;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.save-btn {
    background: #000;
    color: #fff;
}

.save-btn:hover {
    background: #333;
}

/* 微信页面样式已拆分至 wechat.css（阶段 4 第一批） */

/* 合并转发：来源提示（类似微信） */
/* 消息操作界面 */
.message-action-menu {
    position: absolute;
    width: 330px;
    height: 65px;
    background: rgba(240, 238, 235, 0.45); /* #PANTONE 11-4201TCX Cloud Dancer with 45% opacity */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
}

.message-action-menu.show {
    display: flex;
}

.message-action-item {
    width: 75px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.message-action-item:hover {
    background: rgba(255, 255, 255, 0.3);
}

.message-action-icon {
    font-size: 20px;
    margin-bottom: 4px;
    color: #333;
}

.message-action-text {
    font-size: 12px;
    color: #666;
}

/* 回溯确认模态框样式 */
.backtrack-confirm-modal {
    width: 300px;
    max-width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.backtrack-confirm-content {
    padding: 24px;
    text-align: center;
}

.backtrack-confirm-text {
    font-size: 16px;
    color: #333;
    line-height: 1.4;
}

.backtrack-confirm-footer {
    display: flex;
    border-top: 1px solid #f0f0f0;
}

.backtrack-cancel-btn,
.backtrack-confirm-btn {
    flex: 1;
    padding: 16px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.backtrack-cancel-btn {
    background: white;
    color: #666;
    border-right: 1px solid #f0f0f0;
}

.backtrack-cancel-btn:hover {
    background: #f5f5f5;
}

.backtrack-confirm-btn {
    background: #07C160;
    color: white;
}

.backtrack-confirm-btn:hover {
    background: #05a850;
}

/* 确认删除模态框样式 */
.confirm-delete-modal {
    width: 280px;
    height: 180px;
    background: rgba(240, 240, 240, 0.55); /* Cloud Dancer 色值近似，透明度55% */
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    padding: 20px 20px 15px;
    box-sizing: border-box;
}

.confirm-delete-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0 0 20px 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-delete-footer {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    margin-top: 0;
    padding-bottom: 0;
}

.confirm-delete-cancel-btn,
.confirm-delete-confirm-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-delete-cancel-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #d0d0d0;
}

.confirm-delete-cancel-btn:hover {
    background: #e0e0e0;
}

.confirm-delete-confirm-btn {
    background: #333;
    color: white;
}

.confirm-delete-confirm-btn:hover {
    background: #111;
}

/* 引用框架样式 */

.multiselect-info {
    font-size: 13px;
    color: #333;
    flex: 1;
}

.multiselect-actions {
    display: flex;
    gap: 8px;
}

.multiselect-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.select-all-btn {
    background: #f5f5f5;
    color: #333;
}

.select-all-btn:hover {
    background: #e0e0e0;
}

.forward-btn {
    background: #f5f5f5;
    color: #333;
}

.forward-btn:hover {
    background: #e0e0e0;
}

/* 转发好友选择 */
#forward-friends-modal {
    z-index: 1200;
}

.forward-friends-modal-content {
    max-width: 340px;
    width: 88%;
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.forward-friends-header {
    flex-shrink: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.forward-friends-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.forward-friends-body {
    flex: 1;
    min-height: 0;
    padding: 12px 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.forward-friends-hint {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

.forward-friends-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eee;
    border-radius: 8px;
    max-height: 38vh;
}

.forward-friends-empty {
    text-align: center;
    padding: 24px 12px;
    font-size: 14px;
    color: #999;
}

.forward-friend-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.forward-friend-row:last-child {
    border-bottom: none;
}

.forward-friend-row:active {
    background: #f5f5f5;
}

.forward-friend-row.selected {
    background: rgba(7, 193, 96, 0.08);
}

.forward-friend-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
    position: relative;
}

.forward-friend-row.selected .forward-friend-checkbox {
    border-color: #07c160;
    background: #07c160;
}

.forward-friend-row.selected .forward-friend-checkbox::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forward-friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    background: #e0e0e0 center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
}

.forward-friend-name {
    flex: 1;
    font-size: 16px;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forward-friends-footer {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 12px 16px 16px;
    border-top: 1px solid #eee;
}

.forward-friends-cancel-btn,
.forward-friends-send-btn {
    padding: 10px 24px;
    min-height: 36px;
    line-height: 1.2;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.forward-friends-cancel-btn {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.forward-friends-send-btn {
    background: #000;
    color: #fff;
    border: none;
}

.forward-friends-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #999;
}

/* 微信收藏界面（全页） */
.favorites-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    background: #fff;
    z-index: 100;
}

.favorites-page.show {
    display: flex;
}

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

.favorites-back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

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

.favorites-page-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.favorites-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.favorites-tab {
    font-size: 15px;
    color: #999;
    cursor: pointer;
}

.favorites-tab.active {
    color: #07c160;
    font-weight: 500;
}

.favorites-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.favorites-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}

.favorites-empty-text {
    font-size: 16px;
    color: #999;
    margin-bottom: 8px;
}

.favorites-empty-hint {
    font-size: 13px;
    color: #bbb;
    line-height: 1.5;
}

/* 微信钱包界面 */
.wallet-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    background: #f5f5f5;
    z-index: 100;
}

.wallet-page.show {
    display: flex;
}

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

.wallet-back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

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

.wallet-page-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.wallet-balance-card {
    background: #2c2c2e;
    border-radius: 16px;
    padding: 28px 24px;
    color: #fff;
    margin-bottom: 16px;
    text-align: center;
}

.wallet-balance-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.wallet-balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.wallet-balance-amount {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 1px;
}

.wallet-menu-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
}

.wallet-menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.wallet-menu-item:last-child {
    border-bottom: none;
}

.wallet-menu-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.wallet-menu-name {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.wallet-menu-value {
    font-size: 14px;
    color: #999;
    margin-right: 4px;
}

.wallet-menu-arrow {
    font-size: 18px;
    color: #ccc;
}

.wallet-menu-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.wallet-menu-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wallet-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ddd;
    border-radius: 28px;
    transition: 0.3s;
}

.wallet-toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wallet-menu-toggle input:checked + .wallet-toggle-slider {
    background: #07c160;
}

.wallet-menu-toggle input:checked + .wallet-toggle-slider::before {
    transform: translateX(22px);
}

/* 账单界面 */
.wallet-bills-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    background: #f5f5f5;
    z-index: 102;
}

.wallet-bills-page.show {
    display: flex;
}

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

.wallet-bills-back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

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

.wallet-bills-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
}

.wallet-bills-summary-card {
    border-radius: 16px;
    padding: 16px;
    color: #fff;
}

.wallet-bills-summary-card.income {
    background: linear-gradient(135deg, #20b26b, #4fd08d);
}

.wallet-bills-summary-card.expense {
    background: linear-gradient(135deg, #2f3136, #52555d);
}

.wallet-bills-summary-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.wallet-bills-summary-amount {
    font-size: 24px;
    font-weight: 700;
}

.wallet-bills-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.wallet-bill-group {
    margin-bottom: 18px;
}

.wallet-bill-group-title {
    font-size: 13px;
    color: #888;
    margin: 0 0 10px;
    padding: 0 4px;
}

.wallet-bill-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 14px;
    margin-bottom: 10px;
}

.wallet-bill-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.wallet-bill-main {
    flex: 1;
    min-width: 0;
}

.wallet-bill-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.wallet-bill-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.wallet-bill-status {
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    border-radius: 999px;
    padding: 2px 7px;
}

.wallet-bill-desc,
.wallet-bill-meta {
    font-size: 12px;
    color: #8a8a8a;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-bill-side {
    text-align: right;
    flex-shrink: 0;
}

.wallet-bill-amount {
    font-size: 16px;
    font-weight: 700;
}

.wallet-bill-amount.income {
    color: #16a34a;
}

.wallet-bill-amount.expense {
    color: #111;
}

.wallet-bill-time {
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

.wallet-bills-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    padding: 24px;
    text-align: center;
}

.wallet-bills-empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.wallet-bills-empty-hint {
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
}

/* 亲属卡界面 */
.kinship-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    background: #f5f5f5;
    z-index: 101;
}

.kinship-page.show {
    display: flex;
}

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

.kinship-back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

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

.kinship-page-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.kinship-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 24px;
    padding: 12px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.kinship-tab {
    font-size: 15px;
    color: #999;
    cursor: pointer;
}

.kinship-tab.active {
    color: #1a1a1a;
    font-weight: 600;
}

.kinship-give-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.kinship-give-btn:hover {
    background: #333;
}

.kinship-card-list {
    flex: 1;
    overflow-y: auto;
}

.kinship-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #eee;
}

.kinship-card-item:last-child {
    margin-bottom: 0;
}

.kinship-card-friend {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
}

.kinship-card-amount {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.kinship-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}

.kinship-empty-text {
    font-size: 16px;
    color: #999;
    margin-bottom: 8px;
}

.kinship-empty-hint {
    font-size: 13px;
    color: #bbb;
    line-height: 1.5;
}

.kinship-friend-list {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.kinship-friend-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.kinship-friend-item:last-child {
    border-bottom: none;
}

.kinship-friend-item.selected {
    background: #f5f5f5;
}

.kinship-friend-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    background: #e0e0e0;
    flex-shrink: 0;
}

.kinship-friend-item-name {
    font-size: 15px;
    color: #1a1a1a;
}

.payment-method-list {
    max-height: 200px;
    overflow-y: auto;
}

.payment-method-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.payment-method-item:last-child {
    margin-bottom: 0;
}

.payment-method-item:hover {
    background: #f9f9f9;
}

.payment-method-item.is-selected {
    border-color: #ff5000;
    background: #fff8f5;
    box-shadow: 0 0 0 1px rgba(255, 80, 0, 0.15);
}

.payment-method-item.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.payment-method-label {
    font-size: 15px;
    color: #1a1a1a;
}

.payment-method-amount {
    font-size: 14px;
    color: #666;
}

/* 钱包模态框 - 黑白配色 */
.wallet-modal .wallet-modal-content {
    background: #fff;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    overflow: hidden;
}

.wallet-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.wallet-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
}

.wallet-modal-body {
    padding: 24px 20px;
}

.wallet-modal-hint {
    margin: 0 0 16px;
    font-size: 14px;
    color: #666;
}

.wallet-password-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    letter-spacing: 8px;
    text-align: center;
    border: 1px solid #333;
    border-radius: 8px;
    background: #fff;
    color: #1a1a1a;
    box-sizing: border-box;
}

.wallet-password-input::placeholder {
    color: #999;
}

.wallet-amount-input {
    letter-spacing: normal;
}

.wallet-password-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.wallet-modal-error {
    margin: 12px 0 0;
    font-size: 13px;
    color: #c00;
    min-height: 18px;
}

.wallet-modal-footer {
    display: flex;
    border-top: 1px solid #e0e0e0;
}

.wallet-modal-btn {
    flex: 1;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: #fff;
    color: #1a1a1a;
}

.wallet-modal-btn.cancel {
    border-right: 1px solid #e0e0e0;
}

.wallet-modal-btn.cancel:hover {
    background: #f5f5f5;
}

.wallet-modal-btn.confirm {
    background: #1a1a1a;
    color: #fff;
}

.wallet-modal-btn.confirm:hover {
    background: #333;
}

.favorites-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 56px;
}

.favorites-item:last-child {
    border-bottom: none;
}

.favorites-item-content {
    flex: 1;
    min-width: 0;
}

.favorites-item-text {
    font-size: 15px;
    color: #111;
    line-height: 1.4;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.favorites-item-emoji {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.favorites-item-meta {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.favorites-item-delete {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 12px;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;
}

.favorites-item-delete:active {
    color: #ff4757;
}

.favorites-item-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.favorites-item-images img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
}

.favorites-item-source-badge {
    font-size: 11px;
    color: #07c160;
    margin-left: 6px;
}

/* 发现页 - 朋友圈入口 */
.discover-list {
    background: #fff;
}

.discover-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.discover-item:active {
    background: #f5f5f5;
}

.discover-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 14px;
}

.moments-icon {
    background: linear-gradient(135deg, #ffd93d 0%, #ff9500 100%);
}

.discover-item-name {
    flex: 1;
    font-size: 16px;
    color: #111;
}

.discover-item-arrow {
    font-size: 18px;
    color: #ccc;
}

/* 朋友圈页面（微信式：封面顶Fullscreen、状态栏叠图、工具栏在状态栏下；动态流白底） */
.moments-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    /* 透明以便动态流磨砂下层能透出发现页 / 全局背景图 */
    background: transparent;
    z-index: 99;
}

.moments-page.show {
    display: flex;
}

/* 情侣空间页面（发现页内覆盖层） */
.couple-space-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    background: #f2f2f2;
    z-index: 100;
    /* 与小手机顶边仅保留 12px（刘海屏再加 safe-area） */
    --couple-top-gap: calc(12px + env(safe-area-inset-top, 0px));
    --couple-toolbar-slot: 54px;
}

.couple-space-page.show {
    display: flex;
}

.couple-space-topbar {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--couple-top-gap);
    z-index: 150;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 6px 12px 8px;
    gap: 8px;
    pointer-events: none;
}

.couple-space-topbar > * {
    pointer-events: auto;
}

.couple-space-back,
.couple-space-add {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.couple-space-back:active,
.couple-space-add:active {
    transform: translateY(1px);
}

.couple-space-title {
    text-align: center;
    font-size: 17px;
    font-weight: 650;
    color: #111;
    letter-spacing: 0.5px;
}

.couple-space-add-wrap {
    position: relative;
    justify-self: end;
}

.couple-space-ico {
    width: 22px;
    height: 22px;
    display: block;
}

.couple-space-add-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    max-width: min(92vw, 320px);
    max-height: min(52vh, 420px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 8px;
    z-index: 200;
    -webkit-overflow-scrolling: touch;
}

.couple-space-add-menu.is-open {
    display: block;
}

.couple-space-add-empty {
    padding: 10px 10px 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.35;
}

.couple-space-add-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    border-radius: 12px;
    cursor: pointer;
}

.couple-space-add-item:active {
    background: rgba(0, 0, 0, 0.05);
}

.couple-space-add-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #ddd center/cover no-repeat;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    font-weight: 700;
}

.couple-space-add-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.couple-space-add-name {
    font-size: 14px;
    color: #111;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.couple-space-add-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.couple-space-body {
    flex: 1;
    min-height: 0;
    padding: calc(var(--couple-top-gap) + var(--couple-toolbar-slot) + 10px) 14px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.couple-private-page {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    background: linear-gradient(165deg, #dbe2ec 0%, #f7edeb 65%, #e7adac 130%);
    z-index: 12;
    --couple-top-gap: calc(12px + env(safe-area-inset-top, 0px));
    --couple-toolbar-slot: 54px;
}

.couple-private-page.show {
    display: flex;
}

/* 主顶栏 z-index(150) 高于私密层(12)，但子项默认 pointer-events:auto，会挡住同区域的私密顶栏（右上 X 与「+」重叠） */
.couple-space-page.is-private-open .couple-space-topbar,
.couple-space-page.is-private-open .couple-space-topbar * {
    pointer-events: none !important;
}

.couple-space-page.is-private-open .couple-space-topbar {
    opacity: 0;
}

/* 内部页顶栏：与主情侣页 .couple-space-topbar 同一垂直基准，按钮在屏幕左右角、不在名片内 */
.couple-private-toolbar {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--couple-top-gap);
    z-index: 20;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 6px 12px 8px;
    gap: 8px;
    pointer-events: none;
}

.couple-private-toolbar > * {
    pointer-events: auto;
}

.couple-private-toolbar-spacer {
    pointer-events: none;
}

.couple-private-toolbar-back,
.couple-private-toolbar-break {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    justify-self: start;
}

.couple-private-toolbar-break {
    justify-self: end;
    font-size: 16px;
    font-weight: 700;
    color: #8f3b43;
}

.couple-private-toolbar-back:active,
.couple-private-toolbar-break:active {
    transform: translateY(1px);
}

.couple-private-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: calc(var(--couple-top-gap) + var(--couple-toolbar-slot) + 10px) 14px 22px;
}

.couple-private-hero {
    position: relative;
    width: min(92vw, 420px);
    min-height: 292px;
    margin: 6px auto 0;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    background: linear-gradient(145deg, #f7edeb 0%, #dbe2ec 60%, #e7adac 125%);
    box-shadow:
        inset 0 2px 8px rgba(255, 255, 255, 0.95),
        inset 0 -3px 8px rgba(173, 132, 128, 0.14),
        0 10px 26px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    cursor: pointer;
}

.couple-private-hero::before,
.couple-private-hero::after {
    content: '';
    position: absolute;
    top: 18px;
    width: 24px;
    height: 20px;
    border: 1px solid rgba(244, 176, 165, 0.4);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    transform: rotate(-45deg);
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.8);
    opacity: 0.55;
    pointer-events: none;
}

.couple-private-hero::before {
    left: 50%;
    margin-left: -30px;
}

.couple-private-hero::after {
    left: 50%;
    margin-left: -4px;
    transform: rotate(45deg);
}

.couple-private-upload-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(30, 30, 30, 0.55);
    letter-spacing: 0.3px;
    pointer-events: none;
}

.couple-private-hero.is-empty .couple-private-upload-hint {
    opacity: 1;
}

.couple-private-hero:not(.is-empty) .couple-private-upload-hint {
    opacity: 0.68;
}

.couple-private-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 68px;
}

.couple-private-avatar {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: #fff center/cover no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow:
        inset 0 0 0 1px rgba(244, 176, 165, 0.35),
        0 4px 14px rgba(0, 0, 0, 0.12);
}

.couple-private-heartline {
    width: 88px;
    height: 36px;
    flex: 0 0 auto;
    opacity: 0.95;
}

.couple-private-editable-title {
    margin: 18px auto 0;
    width: calc(100% - 34px);
    max-width: 360px;
    min-height: 28px;
    text-align: center;
    color: #373737;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 10px;
    outline: none;
    padding: 4px 8px;
    cursor: text;
}

.couple-private-editable-title:focus {
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 0 0 1px rgba(244, 176, 165, 0.45);
}

.couple-private-meta {
    margin-top: 6px;
    text-align: center;
    font-size: 13px;
    color: rgba(30, 30, 30, 0.7);
}

.couple-private-meta--days {
    margin-top: 3px;
    color: rgba(30, 30, 30, 0.84);
    font-weight: 600;
}

.couple-private-feature-list {
    width: min(92vw, 420px);
    margin: 12px auto 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.couple-private-feature-note {
    height: 56px;
    border: 1px solid rgba(231, 173, 172, 0.6);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0 18%, rgba(247, 237, 235, 0.96) 18% 100%),
        linear-gradient(120deg, rgba(219, 226, 236, 0.85), rgba(231, 173, 172, 0.55));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    color: #38363a;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
}

/* ========== 爱的账单 ========== */
.couple-bill-page {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    z-index: 145;
    background: linear-gradient(165deg, #dbe2ec 0%, #f7edeb 55%, #e7adac 125%);
    --couple-top-gap: calc(12px + env(safe-area-inset-top, 0px));
    --couple-toolbar-slot: 48px;
}

.couple-bill-page.show {
    display: flex;
}

.couple-bill-shell {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: calc(var(--couple-top-gap) + var(--couple-toolbar-slot) + 8px) 14px 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.couple-bill-shell::-webkit-scrollbar {
    display: none;
}

.couple-bill-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(92vw, 420px);
    margin: 0 auto 12px;
}

.couple-bill-tab {
    height: 42px;
    border: 1px solid rgba(231, 173, 172, 0.55);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #5a4a4a;
    font-size: 14px;
    font-weight: 600;
}

.couple-bill-tab.is-active {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(244,176,165,0.42));
    color: #2d2323;
}

.couple-bill-summary {
    width: min(92vw, 420px);
    margin: 0 auto 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.couple-bill-summary-card,
.couple-bill-card,
.couple-bill-record {
    border-radius: 16px;
    border: 1px solid rgba(231, 173, 172, 0.45);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.couple-bill-summary-card {
    padding: 14px;
}

.couple-bill-summary-label {
    font-size: 12px;
    color: rgba(32, 24, 24, 0.66);
}

.couple-bill-summary-value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 700;
    color: #2c2424;
}

.couple-bill-summary-value.is-income,
.couple-bill-record-amount.is-income {
    color: #d65353;
}

.couple-bill-summary-value.is-expense,
.couple-bill-record-amount.is-expense {
    color: #365fbc;
}

.couple-bill-panel {
    display: none;
    width: min(92vw, 420px);
    margin: 0 auto;
}

.couple-bill-panel.show {
    display: block;
}

.couple-bill-card {
    padding: 14px;
}

.couple-bill-card--takeout {
    padding-bottom: 16px;
}

.couple-bill-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.couple-bill-card-title {
    font-size: 15px;
    font-weight: 650;
    color: #2c2424;
}

.couple-bill-refresh-btn {
    min-width: 58px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(219, 226, 236, 0.95);
    color: #364255;
    font-size: 12px;
    font-weight: 600;
}

.couple-bill-refresh-btn:disabled {
    opacity: 0.7;
}

.couple-bill-food-scroll-tip {
    margin-bottom: 10px;
    font-size: 12px;
    color: rgba(45, 35, 35, 0.58);
}

.couple-bill-food-list,
.couple-bill-list {
    display: grid;
    gap: 10px;
}

.couple-bill-food-list {
    max-height: 44vh;
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.couple-bill-food-list.is-longpress-scrolling {
    cursor: grabbing;
}

.couple-bill-food-list::-webkit-scrollbar {
    display: none;
}

.couple-bill-food-section {
    display: grid;
    gap: 8px;
}

.couple-bill-food-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #6f4e4e;
    padding-left: 2px;
}

.couple-bill-food-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.couple-bill-food-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 10px;
    border-radius: 12px;
    background: rgba(247, 237, 235, 0.86);
}

.couple-bill-food-name {
    flex: 1;
    font-size: 13px;
    color: #3f3333;
}

.couple-bill-food-price {
    font-size: 12px;
    color: rgba(63, 51, 51, 0.7);
}

.couple-bill-note-input {
    width: 100%;
    min-height: 72px;
    margin-top: 12px;
    border: 1px solid rgba(231, 173, 172, 0.45);
    border-radius: 12px;
    padding: 10px 12px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.94);
}

.couple-bill-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.couple-bill-primary-btn,
.couple-bill-secondary-btn {
    height: 42px;
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.couple-bill-primary-btn {
    background: linear-gradient(135deg, #f4b0a5, #e78f8f);
    color: #fff;
}

.couple-bill-secondary-btn {
    background: rgba(219, 226, 236, 0.95);
    color: #364255;
}

.couple-bill-list {
    margin-top: 12px;
}

.couple-bill-record {
    padding: 12px 14px;
}

.couple-bill-record--toggle {
    width: 100%;
    border: 1px solid rgba(231, 173, 172, 0.45);
    text-align: left;
    cursor: pointer;
}

.couple-bill-record--toggle.is-open {
    background: rgba(255, 255, 255, 0.92);
}

.couple-bill-record-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.couple-bill-record-tag {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(244, 176, 165, 0.18);
    font-size: 12px;
    color: #7d5454;
}

.couple-bill-record-amount {
    font-size: 16px;
    font-weight: 700;
}

.couple-bill-record-title {
    margin-top: 8px;
    font-size: 14px;
    color: #2d2323;
    line-height: 1.5;
}

.couple-bill-record-meta,
.couple-bill-record-detail {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(45, 35, 35, 0.66);
    line-height: 1.6;
}

.couple-bill-record-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.couple-bill-empty {
    padding: 26px 14px;
    text-align: center;
    color: rgba(45, 35, 35, 0.66);
}

.chat-love-takeout-card {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 14px 14px 12px;
    background: linear-gradient(160deg, #fff9f0 0%, #ffe7cc 100%);
    text-align: left;
}

.chat-love-takeout-card.is-pending {
    background: linear-gradient(160deg, #fff9f0 0%, #ffe7cc 100%);
}

.chat-love-takeout-card.is-ready {
    background: linear-gradient(160deg, #fff6dd 0%, #ffd58f 100%);
}

.chat-love-takeout-card.is-received {
    background: linear-gradient(160deg, #eef8ea 0%, #cfeec6 100%);
}

.chat-love-takeout-status.is-pending {
    color: #c96f20;
}

.chat-love-takeout-status.is-ready {
    color: #b76a00;
}

.chat-love-takeout-status.is-received {
    color: #2e8b57;
}

.chat-love-takeout-cta {
    margin-top: 10px;
    font-size: 12px;
    color: #8b5e32;
}

.couple-takeout-detail-page {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    /* 高于 .chat-input-area(3000) / 表情面板(3100)，从聊天页打开时盖住整页 */
    z-index: 4000;
    background: linear-gradient(165deg, #f6e9d8 0%, #fff7ef 58%, #ffd2a6 125%);
    /* 原嵌套在情侣空间内时继承父级变量；移到 #app 后需自带，避免顶栏与内容区 padding 塌陷 */
    --couple-top-gap: calc(12px + env(safe-area-inset-top, 0px));
    --couple-toolbar-slot: 48px;
}

.couple-takeout-detail-page.show {
    display: flex;
}

.couple-takeout-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: calc(var(--couple-top-gap) + var(--couple-toolbar-slot) + 12px) 14px 18px;
}

.couple-takeout-detail-map,
.couple-takeout-detail-card {
    border-radius: 18px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(231,173,172,0.38);
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.couple-takeout-detail-map {
    padding: 16px;
}

.couple-takeout-map-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.couple-takeout-map-brand {
    font-size: 18px;
    font-weight: 700;
    color: #c96f20;
}

.couple-takeout-map-status {
    font-size: 12px;
    color: rgba(45,35,35,0.72);
}

.couple-takeout-route {
    position: relative;
    height: 160px;
    margin-top: 14px;
}

.couple-takeout-route-line {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 88px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f6c27d, #ef8d55);
}

.couple-takeout-rider {
    position: absolute;
    top: 54px;
    width: 36px;
    height: 48px;
    animation: couple-takeout-rider-bob 1.4s ease-in-out infinite;
}

.couple-takeout-rider-head,
.couple-takeout-rider-body,
.couple-takeout-rider-bike {
    position: absolute;
    display: block;
    background: none;
}

.couple-takeout-rider-head {
    left: 12px;
    top: 0;
    width: 10px;
    height: 10px;
    border: 2px solid #5a4330;
    border-radius: 50%;
}

.couple-takeout-rider-body {
    left: 16px;
    top: 10px;
    width: 2px;
    height: 18px;
    background: #5a4330;
    box-shadow: -8px 8px 0 0 #5a4330, 8px 8px 0 0 #5a4330, -7px 18px 0 0 #5a4330, 7px 18px 0 0 #5a4330;
}

.couple-takeout-rider-bike {
    left: 2px;
    top: 24px;
    width: 32px;
    height: 18px;
    border-bottom: 2px solid #5a4330;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    box-shadow: inset 0 -2px 0 #5a4330;
}

.couple-takeout-receiver {
    position: absolute;
    right: 0;
    top: 66px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4b0a5;
    color: #fff;
    font-weight: 700;
}

.couple-takeout-receiver.is-placeholder {
    background-image: none !important;
}

.couple-takeout-detail-card {
    margin-top: 14px;
    padding: 14px;
}

.couple-takeout-detail-title {
    font-size: 15px;
    font-weight: 700;
    color: #2d2323;
}

.couple-takeout-detail-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.couple-takeout-detail-line,
.couple-takeout-detail-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    color: #3f3333;
}

.couple-takeout-detail-total {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(63,51,51,0.18);
    font-weight: 700;
}

.couple-takeout-detail-actions {
    margin-top: 14px;
}

.couple-takeout-confirm-btn {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #f4b0a5, #e78f8f);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.couple-takeout-confirm-btn:disabled {
    background: rgba(179, 169, 169, 0.72);
}

.couple-takeout-confirm-btn.is-done {
    background: linear-gradient(135deg, #f0c17b, #ef9c57);
}

@keyframes couple-takeout-rider-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ========== 情侣日记（封面翻页 + 内页横格） ========== */
.couple-diary-page {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    z-index: 140;
    background: linear-gradient(165deg, #dbe2ec 0%, #f7edeb 55%, #e7adac 125%);
    --couple-top-gap: calc(12px + env(safe-area-inset-top, 0px));
    --couple-toolbar-slot: 48px;
}

.couple-diary-page.show {
    display: flex;
}

/* 日记页打开时仅禁止下方内容区接盘点击；顶栏「返回 / 解除」需可点。整页 pointer-events:none 在部分 WebView 会导致子按钮仍无法点击 */
.couple-space-page.is-diary-open .couple-private-body {
    pointer-events: none;
}

.couple-diary-toolbar {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--couple-top-gap);
    z-index: 2;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 6px 12px 8px;
    gap: 8px;
    pointer-events: none;
}

.couple-diary-toolbar > * {
    pointer-events: auto;
}

.couple-diary-toolbar-back {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    justify-self: start;
}

.couple-diary-toolbar-title {
    text-align: center;
    font-size: 17px;
    font-weight: 650;
    color: #111;
}

.couple-diary-toolbar-spacer {
    width: 40px;
    height: 40px;
    justify-self: end;
}

.couple-diary-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* 贴合 #app 手机可视区宽度；高度占满顶栏下方，避免 vw/vh 相对浏览器视口导致与手机框不一致 */
    padding: calc(var(--couple-top-gap) + var(--couple-toolbar-slot) + 8px) 0 calc(12px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
}

.couple-diary-scene {
    flex: 1;
    min-height: 0;
    width: 100%;
    margin: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    perspective: 1100px;
}

.couple-diary-flip {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.couple-diary-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: center center;
    transition: transform 0.72s cubic-bezier(0.4, 0.02, 0.2, 1);
}

.couple-diary-flip.is-open .couple-diary-flip-inner {
    transform: rotateY(-180deg);
}

.couple-diary-face {
    position: absolute;
    inset: 0;
    border-radius: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.couple-diary-face--cover {
    background: linear-gradient(145deg, #fdf8f5 0%, #f0e4df 100%);
    border: 1px solid rgba(231, 173, 172, 0.45);
    cursor: pointer;
}

.couple-diary-cover-bg {
    position: absolute;
    inset: 0;
    background: #f7edeb center/cover no-repeat;
}

.couple-diary-cover-bg.has-image {
    background-color: #ddd;
}

.couple-diary-cover-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 14px;
    color: rgba(40, 40, 40, 0.55);
    text-align: center;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
    max-width: 80%;
    line-height: 1.45;
}

.couple-diary-face--cover.has-cover-image .couple-diary-cover-hint {
    top: auto;
    bottom: 56px;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.couple-diary-cover-upload-btn {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #3a3638;
    border: 1px solid rgba(231, 173, 172, 0.65);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.couple-diary-face--inside {
    transform: rotateY(180deg);
    background: #fffaf6;
    border: 1px solid rgba(200, 190, 185, 0.45);
    display: flex;
    flex-direction: column;
}

.couple-diary-inner-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px;
    box-sizing: border-box;
}

.couple-diary-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 8px 8px;
}

.couple-diary-nav-label {
    font-size: 12px;
    color: rgba(40, 40, 40, 0.65);
    min-width: 72px;
    text-align: center;
}

.couple-diary-nav-btn {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #4a4548;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.couple-diary-nav-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.couple-diary-nav-btn--accent {
    border-color: rgba(231, 173, 172, 0.75);
    background: rgba(247, 237, 235, 0.95);
    color: #6b3e42;
}

.couple-diary-char-block {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-top: 10px;
    padding: 10px 8px 8px;
    border-top: 1px dashed rgba(190, 175, 165, 0.45);
}

.couple-diary-char-block::-webkit-scrollbar {
    display: none;
}

.couple-diary-char-label {
    font-size: 12px;
    font-weight: 650;
    color: rgba(90, 70, 75, 0.85);
    margin-bottom: 6px;
}

.couple-diary-char-reply {
    font-size: 14px;
    line-height: 1.55;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

.couple-diary-char-reply.is-placeholder {
    color: rgba(120, 110, 105, 0.55);
    font-size: 13px;
}

.couple-diary-char-loading {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(231, 173, 172, 0.95);
}

.couple-diary-paper {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0 0 12px;
    padding: 10px 10px 12px;
    border-radius: 12px;
    background-color: #fffdf9;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 27px,
        rgba(200, 180, 170, 0.35) 27px,
        rgba(200, 180, 170, 0.35) 28px
    );
    border: 1px solid rgba(220, 210, 200, 0.6);
}

.couple-diary-lined-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
}

.couple-diary-line-row {
    display: block;
    width: 100%;
    min-height: 28px;
    line-height: 28px;
    padding: 0 6px;
    margin: 0;
    text-align: left;
    font-size: 15px;
    color: #2c2c2c;
    border: none;
    border-bottom: 1px dashed rgba(190, 175, 165, 0.55);
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.couple-diary-line-row.is-empty {
    color: rgba(120, 110, 105, 0.35);
}

.couple-diary-line-row:active {
    background: rgba(231, 173, 172, 0.12);
}

.couple-diary-save-btn {
    flex-shrink: 0;
    align-self: flex-end;
    margin-top: 10px;
    margin-bottom: 2px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 650;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #e7adac 0%, #d8898a 100%);
    box-shadow: 0 4px 12px rgba(180, 100, 100, 0.35);
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

/* 正文已保存且与上次保存一致：弱化按钮，避免挡住阅读 */
.couple-diary-save-btn.is-saved-clean {
    opacity: 0.48;
    box-shadow: 0 2px 8px rgba(180, 100, 100, 0.2);
}

.couple-diary-line-sheet {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.couple-diary-line-sheet.show {
    display: flex;
}

.couple-diary-line-sheet-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.couple-diary-line-sheet-panel {
    position: relative;
    width: 100%;
    max-width: min(92vw, 400px);
    margin: 12px;
    margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.18);
}

.couple-diary-line-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 650;
    color: #222;
}

.couple-diary-line-sheet-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
}

.couple-diary-line-textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.45;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-sizing: border-box;
}

.couple-diary-line-sheet-ok {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    font-size: 15px;
    font-weight: 650;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #dbe2ec 0%, #9fb0c4 120%);
}

.couple-space-hint {
    font-size: 13px;
    color: #666;
    line-height: 1.45;
    padding: 2px 2px 10px;
}

/* 情侣空间「名片入口」：双头像 + 一箭穿心（线性图标） */
.couple-space-entry-card {
    width: min(92vw, 420px);
    margin: 6px auto 0;
    border-radius: 18px;
    border: 1px solid rgba(244, 176, 165, 0.55);
    background: linear-gradient(135deg, rgba(247, 240, 234, 0.92) 0%, rgba(244, 176, 165, 0.55) 120%);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
    padding: 14px 14px 12px;
    cursor: pointer;
}

.couple-space-entry-card-title {
    text-align: center;
    font-size: 13px;
    color: rgba(17, 17, 17, 0.72);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.couple-space-entry-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.couple-space-entry-avatar {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: #fff 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;
}

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

.couple-space-entry-foot {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: rgba(17, 17, 17, 0.55);
}

/* 与 .status-bar 同公式：顶 padding(max(12,safe)) + 底 12 + 内容行约 22，再下移 10px 躲开时间行；再上移 8px 微调对齐 */
.moments-floating-toolbar {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(max(12px, env(safe-area-inset-top, 0px)) + 12px + 22px + 10px - 8px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 14px;
    pointer-events: none;
}

.moments-floating-toolbar > * {
    pointer-events: auto;
}

.moments-toolbar-back {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.moments-toolbar-back:active {
    opacity: 0.75;
}

.moments-toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.moments-toolbar-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.moments-toolbar-icon-btn:active {
    opacity: 0.75;
}

@keyframes moments-refresh-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.moments-toolbar-icon-btn.is-moments-refresh-loading {
    pointer-events: none;
    opacity: 0.9;
}

.moments-toolbar-icon-btn.is-moments-refresh-loading .moments-line-icon {
    animation: moments-refresh-spin 0.75s linear infinite;
    transform-origin: 50% 50%;
}

.moments-line-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: block;
}

.moments-line-icon--md {
    width: 28px;
    height: 28px;
}

.moments-page-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    background: transparent;
}

.moments-ins-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    background: transparent;
    /* 隐藏滚动条，保留滚动（避免右侧白条影响封面美观） */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.moments-ins-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

/* 名片区：仅封面；头像在右下角「压」在封面与动态流分界上 */
.moments-ins-hero {
    position: relative;
    z-index: 1;
}

.moments-cover-wrap {
    position: relative;
    height: clamp(132px, 36vw, 200px);
    overflow: visible;
    cursor: pointer;
}

.moments-cover-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #5b9bd5 0%,rgb(110, 130, 174) 45%,rgb(86, 95, 118) 100%);
    background-size: cover;
    background-position: center;
}

.moments-cover-bg.has-cover {
    background-color: #2a2a2a;
}

.moments-cover-hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    max-width: 60%;
}

/* 昵称在封面右下角，头像左侧（微信惯例） */
.moments-cover-bottom-meta {
    position: absolute;
    right: 12px;
    bottom: 0;
    transform: translateY(25%);
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    z-index: 3;
}

.moments-ins-nickname {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    margin-bottom: 6px;
    max-width: 42vw;
    text-align: right;
    line-height: 1.25;
    word-break: break-word;
}

/* 微信式方头像，约 1/4 落在封面下、3/4 在封面上 */
.moments-ins-avatar-wrap {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    background: #ddd;
    flex-shrink: 0;
}

.moments-ins-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.moments-ins-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: #666;
    background: #e8e8e8;
}

/* 动态流区域：底层透明；单条动态为 #F4F4F4 @ 55% 不透明 + 磨砂，兼顾背景透出与可读性 */
.moments-feed-container {
    position: relative;
    z-index: 0;
    background: transparent;
    padding: 28px 10px 8px;
    min-height: 120px;
}

.moments-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.moments-post-card {
    padding: 14px 12px 16px;
    margin: 0 2px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    background: rgba(244, 244, 244, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.moments-post-card:last-child {
    margin-bottom: 4px;
}

/* 每条：左方头像 + 右内容（微信排布） */
.moments-post-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.moments-post-avatar-col {
    flex-shrink: 0;
    width: 46px;
}

.moments-post-main {
    flex: 1;
    min-width: 0;
}

.moments-post-avatar {
    width: 46px;
    height: 46px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

.moments-post-avatar-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 4px;
    background: linear-gradient(135deg, #cfd8dc, #90a4ae);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.moments-post-name {
    font-size: 15px;
    font-weight: 600;
    color: #576b95;
    margin-bottom: 5px;
    line-height: 1.3;
}

.moments-post-content {
    font-size: 15px;
    color: #111;
    line-height: 1.55;
    word-break: break-word;
    margin-bottom: 8px;
}

.moments-post-polaroid-host {
    margin: 8px 0 10px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 朋友圈内的规范③拍立得（与聊天同源 class，避免依赖消息内联 style） */
.moments-post-polaroid-host .wechat-polaroid-wrap,
.moments-polaroid-in-feed.wechat-polaroid-wrap,
.chat-message-bubble .wechat-polaroid-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
    width: 260px;
    max-width: 100%;
    background: #fcfbf9;
    padding: 14px 14px 22px 14px;
    margin: 0;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(170, 160, 140, 0.08), 0 20px 40px rgba(170, 160, 140, 0.12);
    border: 1px solid rgba(230, 225, 215, 0.6);
    font-family: -apple-system, "PingFang SC", sans-serif;
    box-sizing: border-box;
}

/* 聊天内：覆盖模型内联 style（如 flex-direction:row），强制竖排，避免配文被挤到右侧成竖条 */
.chat-message-bubble .wechat-polaroid-wrap {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    align-self: stretch;
}

.moments-post-polaroid-host .wechat-polaroid-imgbox,
.moments-polaroid-in-feed .wechat-polaroid-imgbox,
.chat-message-bubble .wechat-polaroid-imgbox {
    width: 100%;
    aspect-ratio: 3/4;
    position: relative;
    flex-shrink: 0;
    min-width: 0;
    isolation: isolate;
    background: #e8e6e3 linear-gradient(180deg, #eceae7 0%, #ddd9d4 100%);
    overflow: hidden;
}

.moments-post-polaroid-host .wechat-polaroid-imgbox::after,
.moments-polaroid-in-feed .wechat-polaroid-imgbox::after,
.chat-message-bubble .wechat-polaroid-imgbox::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03), inset 0 3px 8px rgba(0, 0, 0, 0.04);
    pointer-events: none;
    z-index: 2;
    background: transparent;
}

/* 须用绝对定位铺满相框：父级仅靠 aspect-ratio 时 height:100% 常无法解析，会导致 img 以原尺寸排在灰框下方 */
.moments-post-polaroid-host .wechat-polaroid-img,
.moments-polaroid-in-feed .wechat-polaroid-img,
.chat-message-bubble .wechat-polaroid-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: contrast(1.05) brightness(0.98) saturate(0.85) sepia(12%);
    z-index: 1;
}

.moments-post-polaroid-host .wechat-polaroid-text,
.moments-polaroid-in-feed .wechat-polaroid-text,
.chat-message-bubble .wechat-polaroid-text {
    margin-top: 18px;
    padding: 0 2px;
}

.moments-post-polaroid-host .wechat-polaroid-line,
.moments-polaroid-in-feed .wechat-polaroid-line,
.chat-message-bubble .wechat-polaroid-line {
    width: 16px;
    height: 1px;
    background: #c8c3bc;
    margin-bottom: 10px;
}

.moments-post-polaroid-host .wechat-polaroid-caption,
.moments-polaroid-in-feed .wechat-polaroid-caption,
.chat-message-bubble .wechat-polaroid-caption {
    font-size: 13px;
    color: #55504b;
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-align: justify;
}

.chat-message-bubble .wechat-polaroid-text {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.chat-message-bubble .wechat-polaroid-caption {
    writing-mode: horizontal-tb;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.moments-post-polaroid-host .wechat-polaroid-meta,
.moments-polaroid-in-feed .wechat-polaroid-meta,
.chat-message-bubble .wechat-polaroid-meta {
    margin-top: 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 10.5px;
    color: #b5b0a8;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
}

.moments-post-content .chat-emoji {
    max-width: 75px;
    max-height: 75px;
    width: auto;
    height: auto;
    vertical-align: middle;
    display: inline-block;
    margin: 2px 2px 0 0;
}

/* 时间 + 右下角「··」；展开为微信式深色条（赞 / 评论 / 收藏） */
.moments-post-meta-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    min-height: 26px;
    width: 100%;
    box-sizing: border-box;
}

.moments-post-time-inline {
    font-size: 12px;
    color: #b2b2b2;
}

.moments-post-more-wrap {
    position: relative;
    flex-shrink: 0;
    z-index: 4;
}

.moments-post-more-btn {
    width: 34px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: #f0f0f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}

.moments-post-more-btn:active {
    opacity: 0.85;
}

.moments-post-more-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #3d3d3d;
}

.moments-post-menu {
    display: none;
    position: absolute;
    right: 100%;
    margin-right: 8px;
    bottom: 0;
    z-index: 60;
    flex-direction: row;
    align-items: stretch;
    background: #4c4c4c;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.moments-post-menu.is-open {
    display: flex;
}

.moments-post-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 9px;
    min-height: 34px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    border-right: 1px solid rgba(0, 0, 0, 0.28);
}

.moments-post-menu-item:last-child {
    border-right: none;
}

.moments-post-menu-item:active {
    background: rgba(255, 255, 255, 0.12);
}

.moments-menu-ico {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.moments-post-images {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.moments-post-images--n1 {
    grid-template-columns: 1fr;
}

.moments-post-images--n1 img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 10px;
}

.moments-post-images--n2 {
    grid-template-columns: 1fr 1fr;
}

.moments-post-images--n2 img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

.moments-post-images--n3,
.moments-post-images--n4,
.moments-post-images--n5,
.moments-post-images--n6,
.moments-post-images--n7,
.moments-post-images--n8,
.moments-post-images--n9 {
    grid-template-columns: repeat(3, 1fr);
}

.moments-post-images--n3 img,
.moments-post-images--n4 img,
.moments-post-images--n5 img,
.moments-post-images--n6 img,
.moments-post-images--n7 img,
.moments-post-images--n8 img,
.moments-post-images--n9 img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}

.moments-post-social-box {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 8px 10px;
    margin-top: 4px;
    font-size: 13px;
    color: #262626;
    line-height: 1.45;
}

.moments-post-like-strip {
    color: #262626;
    margin-bottom: 6px;
}

.moments-post-like-strip:last-child {
    margin-bottom: 0;
}

.moments-post-like-icon {
    color: #ed4956;
    margin-right: 4px;
}

.moments-post-comments {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 6px;
    margin-top: 6px;
}

.moments-post-comments:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.moments-post-comment-line {
    margin-top: 4px;
    word-break: break-word;
}

.moments-post-comment-line:first-child {
    margin-top: 0;
}

.moments-post-comment-line--interactive {
    cursor: pointer;
    border-radius: 4px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.06);
}

.moments-post-comment-line--interactive:active {
    background: rgba(0, 0, 0, 0.04);
}

.moments-post-comment-author {
    font-weight: 600;
    color: #385898;
}

.moments-empty {
    text-align: center;
    padding: 40px 20px;
    margin: 8px 4px 0;
    border-radius: 14px;
    background: rgba(244, 244, 244, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.52);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.moments-empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.moments-empty-hint {
    font-size: 13px;
    color: #888;
}

/* 发朋友圈模态框 */
.post-moments-modal-content {
    max-width: 360px;
    width: 92%;
    padding: 0;
}

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

.post-moments-header h3 {
    margin: 0;
    font-size: 17px;
}

.post-moments-cancel,
.post-moments-publish {
    font-size: 15px;
    background: none;
    border: none;
    cursor: pointer;
}

.post-moments-cancel { color: #666; }
.post-moments-publish { color: #07c160; font-weight: 500; }

.post-moments-body {
    padding: 16px;
}

.post-moments-body textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    font-size: 15px;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.moments-image-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.moments-image-add {
    width: 72px;
    height: 72px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #999;
    cursor: pointer;
}

.moments-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.moments-image-previews img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
}

/* 朋友圈评论弹窗 */
.moments-comment-modal-content {
    max-width: 360px;
    width: 92%;
    padding: 0;
}

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

.moments-comment-title {
    font-size: 17px;
    font-weight: 600;
    color: #111;
}

.moments-comment-cancel,
.moments-comment-send {
    font-size: 15px;
    background: none;
    border: none;
    cursor: pointer;
}

.moments-comment-cancel { color: #666; }
.moments-comment-send { color: #07c160; font-weight: 500; }

.moments-comment-input {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: none;
    font-size: 15px;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.favorite-btn {
    background: #f5f5f5;
    color: #333;
}

.favorite-btn:hover {
    background: #e0e0e0;
}

.delete-btn {
    background: #ff4757;
    color: white;
}

.delete-btn:hover {
    background: #ff3742;
}

.cancel-btn {
    background: #f5f5f5;
    color: #333;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

/* 消息选择框样式 */
.chat-message-selector {
    position: absolute;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-message-selector:hover {
    background: transparent;
}

.chat-message-selector.selected {
    background: transparent;
    color: transparent;
}

.chat-message-selector.selected::after {
    content: '';
}

/* 消息选中状态 */
.chat-message.selected {
    background-color: #f0f9ff;
}

/* 编辑消息模态框样式 */
.edit-message-modal {
    width: 300px;
    max-width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.edit-message-modal .modal-header {
    padding: 20px 24px 0;
    text-align: center;
}

.edit-message-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.edit-message-modal .modal-body {
    padding: 24px;
}

.edit-message-input {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
}

.edit-message-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.edit-message-footer {
    display: flex;
    border-top: 1px solid #f0f0f0;
    padding: 16px 24px;
    gap: 12px;
}

.edit-cancel-btn,
.edit-confirm-btn {
    flex: 1;
    height: 34px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-cancel-btn {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.edit-cancel-btn:hover {
    background: #f5f5f5;
}

.edit-confirm-btn {
    background: black;
    color: white;
}

.edit-confirm-btn:hover {
    background: #333;
}

.chat-input-area {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    background: rgba(191, 189, 195, 0.45); /* #PANTONE 663 C with 45% opacity */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px 20px 0 0;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    min-width: 0;
    box-sizing: border-box;
}

.chat-function-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.chat-function-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.receive-btn {
    background-image: url('icons/receive.png');
}

.receive-btn.loading {
    background-image: none;
}

.receive-btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-top-color: #07C160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.emoji-btn {
    background-image: url('icons/emoji.png');
}

.more-btn {
    background-image: url('icons/more.png');
}

.send-btn {
    background-image: url('icons/send.png');
}

.chat-input {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    /* iOS Safari：小于 16px 的输入框聚焦时会强制放大视口，导致「小手机」画面放大 */
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

/* 极窄屏：压缩底栏留白，避免 flex 行溢出裁掉「接收/表情/更多/发送」按钮（国产机微信内置浏览器常见） */
@media (max-width: 360px) {
    .chat-input-area {
        gap: 6px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .chat-function-btn {
        width: 32px;
        height: 32px;
    }

    .chat-input {
        padding: 8px 12px;
    }
}

/* 查找聊天记录模态框样式 */
.search-chat-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;
}

.search-chat-modal .modal-header {
    border-bottom: 1px solid #e5e5e5;
}

.search-chat-input {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.search-chat-input:focus {
    outline: none;
    border-color: #07C160;
    background: white;
}

.search-results {
    height: 100%;
    overflow-y: auto;
}

.search-placeholder {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.search-result-content {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-content .highlight {
    background: #fff3cd;
    color: #d63384;
    padding: 0 2px;
    border-radius: 2px;
}

.search-no-result {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

/* 清空聊天记录确认提示框 */
.clear-chat-confirm-modal {
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    overflow: hidden;
}

.clear-chat-confirm-content {
    padding: 40px 30px;
    text-align: center;
}

.clear-chat-confirm-text {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.clear-chat-confirm-footer {
    display: flex;
    border-top: 1px solid #e5e5e5;
}

.clear-chat-cancel-btn,
.clear-chat-confirm-btn {
    flex: 1;
    padding: 16px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-chat-cancel-btn {
    color: #333;
    border-right: 1px solid #e5e5e5;
}

.clear-chat-cancel-btn:hover {
    background: #f5f5f5;
}

.clear-chat-confirm-btn {
    color: #d63384;
    font-weight: 500;
}

.clear-chat-confirm-btn:hover {
    background: #fff5f5;
}

/* 删除并退出确认提示框 */
.delete-friend-confirm-modal {
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    overflow: hidden;
}

.delete-friend-confirm-content {
    padding: 40px 30px;
    text-align: center;
}

.delete-friend-confirm-text {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.delete-friend-confirm-footer {
    display: flex;
    border-top: 1px solid #e5e5e5;
}

.delete-friend-cancel-btn,
.delete-friend-confirm-btn {
    flex: 1;
    padding: 16px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-friend-cancel-btn {
    color: #333;
    border-right: 1px solid #e5e5e5;
}

.delete-friend-cancel-btn:hover {
    background: #f5f5f5;
}

.delete-friend-confirm-btn {
    color: #d63384;
    font-weight: 500;
}

.delete-friend-confirm-btn:hover {
    background: #fff5f5;
}

/* 聊天设置模态框 */

/* 删除并退出按钮 */
.delete-and-exit-btn {
    margin-top: 24px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.delete-and-exit-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.delete-and-exit-btn span {
    font-size: 16px;
    font-weight: 500;
    color: #ff3b30;
}

/* 好友设置模态框 */
.friend-settings-modal {
    width: 90%;
    max-width: 400px;
    background: rgba(240, 240, 240, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    overflow: hidden;
}

.friend-settings-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.friend-settings-content::-webkit-scrollbar {
    width: 6px;
}

.friend-settings-content::-webkit-scrollbar-track {
    background: transparent;
}

.friend-settings-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* 头像上传部分 */
.avatar-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar-placeholder {
    font-size: 36px;
    font-weight: 600;
    color: #999;
}

#avatar-upload {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 好友设置主头像：与 #avatar-upload 一致，避免原生 file 控件文案露出圆形容器 */
#fs-avatar-upload {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.avatar-hint {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 好友信息部分 */
.friend-info-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.friend-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.friend-info-value {
    font-size: 14px;
    color: #999;
}

.role-setting {
    flex: 1;
    margin-left: 20px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

/* 编辑状态样式 */
.friend-info-edit {
    flex: 1;
    margin-left: 20px;
}

.friend-info-edit input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.friend-info-edit input:focus {
    border-color: #ddd;
    box-shadow: none;
}

.role-setting-edit {
    flex: 1;
    margin-left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-setting-edit input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f5f5f5;
}

.role-setting-edit button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-setting-edit button:first-of-type {
    background: #007aff;
    color: #fff;
}

.role-setting-edit button:first-of-type:hover {
    background: #0056b3;
}

.role-setting-edit button:last-of-type {
    background: #f5f5f5;
    color: #333;
}

.role-setting-edit button:last-of-type:hover {
    background: #e0e0e0;
}

/* 角色设定容器 */
.role-setting-container {
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-setting-container:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.role-setting-header {
    margin-bottom: 12px;
}

.role-setting-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.role-setting-content {
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.role-setting-preview-truncated-hint {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    line-height: 1.4;
}

.role-setting-edit {
    display: block;
    max-height: 300px;
    overflow: hidden;
}

.resizeable-textarea-container {
    position: relative;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    min-height: 100px;
    max-height: 250px;
    overflow: hidden;
}

.resizeable-textarea {
    width: 100%;
    height: 100%;
    min-height: 100px;
    min-width: 100%;
    max-width: 100%;
    max-height: 250px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f5f5f5;
    resize: none;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

.resizeable-textarea:focus {
    border-color: #ddd;
    box-shadow: none;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #ccc;
    border-radius: 0 0 8px 0;
    cursor: nwse-resize;
    transition: all 0.2s ease;
    z-index: 10;
}

.resize-handle:hover {
    background-color: #999;
    width: 16px;
    height: 16px;
}

.resize-handle:active {
    background-color: #666;
}

/* 头像上传进度提示 */
.avatar-upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #007aff;
    width: 0%;
    transition: width 0.3s ease;
}

/* 增加点击反馈 */
.friend-info-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

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


/* 音色ID输入框样式 */
#fs-voice-id-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #f5f5f5;
}

#fs-voice-id-input:focus {
    border-color: #07C160;
}

/* 音色语言 / Char 输出语言选择器样式 */
#fs-voice-language-select,
#fs-output-language-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #f5f5f5;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

#fs-voice-language-select:focus,
#fs-output-language-select:focus {
    border-color: #07C160;
}


/* 保存按钮 */
.save-button {
    padding: 16px;
    background: #000;
    color: #fff;
    border-radius: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.save-button:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* 群聊设置：成员管理 */
.group-members-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.group-members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.group-members-list,
.group-sync-members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(245, 245, 245, 0.9);
    border-radius: 10px;
}

.group-member-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.group-member-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e9e9e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #888;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex: 0 0 auto;
}

.group-member-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.group-member-remove-btn {
    border: none;
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.group-member-remove-btn:hover {
    background: rgba(255, 59, 48, 0.18);
}

.group-members-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.group-members-add-btn {
    border: none;
    background: rgba(7, 193, 96, 0.12);
    color: #07C160;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.group-members-add-btn:hover {
    background: rgba(7, 193, 96, 0.18);
}

.group-sync-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(245, 245, 245, 0.9);
    border-radius: 10px;
}

.group-sync-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #777;
    line-height: 1.5;
}

/* 群聊气泡 CSS 编辑器 */
.group-bubble-css-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.group-bubble-css-textarea {
    width: 100%;
    min-height: 130px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.45;
    background: rgba(245,245,245,0.9);
    box-sizing: border-box;
    outline: none;
    resize: vertical;
}

.group-bubble-css-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 开关样式 */
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e0e0e0;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4cd964;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.chat-input-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

/* 更多功能面板 - 磨砂玻璃质感 */

/* 一起听 - iOS风格灵动岛 */

.read-together-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.read-together-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.read-together-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.read-together-refresh-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.read-together-refresh-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

.read-together-refresh-btn.loading svg {
    animation: read-refresh-spin 0.8s linear infinite;
}

@keyframes read-refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.read-together-refresh-btn svg {
    width: 18px;
    height: 18px;
    color: #333;
}

.read-together-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    border-radius: 4px;
}

.read-together-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.read-together-shelf {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.read-together-empty {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 32px 16px;
}

.read-together-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.read-together-book {
    cursor: pointer;
    transition: transform 0.2s;
}

.read-together-book:hover {
    transform: translateY(-2px);
}

.read-together-book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 6px;
    background: #eee center/cover no-repeat;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.read-together-book-title {
    font-size: 11px;
    color: #333;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* 读后感 - Instagram 风格弹窗 */
.read-review-modal {
    z-index: 2500;
}

.read-review-container {
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}

.read-review-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
    gap: 12px;
}

.read-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.read-review-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.read-review-friend-name {
    font-size: 15px;
    font-weight: 600;
    color: #262626;
}

.read-review-book-title {
    font-size: 13px;
    color: #8e8e8e;
}

.read-review-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.read-review-content {
    padding: 20px 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #262626;
    max-height: 50vh;
    overflow-y: auto;
}

/* 位置分享弹窗 */
.location-modal {
    z-index: 2000;
}

/* 线下模式弹窗（聊天-更多-线下模式） */
.offline-mode-modal,
.offline-style-picker-modal,
.offline-style-new-modal {
    z-index: 2200;
}

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

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

.offline-mode-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #222;
}

.offline-mode-close {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.offline-mode-body {
    padding: 16px;
}

.offline-mode-field {
    margin-bottom: 14px;
}

.offline-mode-field:last-child {
    margin-bottom: 0;
}

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

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

.offline-mode-input:focus {
    outline: none;
    border-color: #07C160;
}

.offline-mode-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

.offline-mode-pov-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.offline-mode-pov-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    background: #fafafa;
}

.offline-mode-pov-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.offline-mode-pov-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #A1FFCE 0%, #FAFFD1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #2b2b2b;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.offline-mode-pov-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.offline-mode-pov-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offline-mode-select {
    width: 100%;
    padding: 10px 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
}

.offline-mode-style-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.offline-mode-style-display {
    cursor: pointer;
}

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

.offline-mode-footer,
.offline-style-picker-footer,
.offline-style-new-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #eee;
}

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

.offline-mode-btn.cancel {
    background: #f0f0f0;
    color: #333;
}

.offline-mode-btn.confirm {
    background: #07C160;
    color: #fff;
}

.offline-mode-btn.confirm:hover {
    background: #06ad56;
}

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

.offline-style-picker-title {
    font-size: 16px;
    font-weight: 800;
    color: #222;
}

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

.offline-style-picker-body {
    padding: 12px 10px;
    max-height: 52vh;
    overflow-y: auto;
}

/* 聊天记忆总结（更多->总结） */

/* 长记忆管理（黑/灰/白/红 线性图标风） */
.chat-long-memory-modal {
    z-index: 2260;
    /* 覆盖 .modal 的 fixed：让长记忆界面贴合 #app 容器大小（与聊天界面同尺寸） */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #fff; /* 覆盖 .modal 的半透明遮罩 */
    overflow: hidden;
}

/* 长记忆管理：全屏独立界面（占满小手机屏幕） */
.chat-long-memory-modal.show {
    align-items: stretch;
    justify-content: stretch;
}

.chat-long-memory-content {
    width: 100%;
    max-width: none;
    height: 100%;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-long-memory-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 10px 10px;
    border-bottom: 1px solid #eee;
}

.chat-long-memory-title {
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-long-memory-back,
.chat-long-memory-edit {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #111;
    padding: 6px;
    cursor: pointer;
}

.chat-long-memory-back svg,
.chat-long-memory-edit svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-long-memory-body {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
}

.chat-long-memory-empty {
    padding: 22px 10px;
    text-align: center;
    font-size: 13px;
    color: #777;
}

.chat-long-memory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-long-memory-card {
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.chat-long-memory-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.chat-long-memory-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-long-memory-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    color: #111;
    cursor: pointer;
    padding: 6px;
}

.chat-long-memory-icon-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-long-memory-icon-btn.danger {
    border-color: rgba(220,38,38,0.35);
    color: #dc2626;
}

.chat-long-memory-card-meta {
    font-size: 12px;
    color: #666;
    font-weight: 700;
}

.chat-long-memory-card-body {
    padding: 12px 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: #222;
    white-space: pre-wrap;
}

.chat-long-memory-edit-modal {
    z-index: 2270;
}

.chat-long-memory-edit-content {
    width: 360px;
    max-width: 94%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    overflow: hidden;
}

.chat-long-memory-edit-header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.chat-long-memory-edit-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    color: #111;
    text-align: center;
}

.chat-long-memory-edit-body {
    padding: 14px 16px;
}

.chat-long-memory-edit-textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 140px;
    color: #111;
}

.chat-long-memory-edit-textarea:focus {
    outline: none;
    border-color: #111;
}

.chat-long-memory-edit-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #eee;
}

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

.chat-long-memory-btn.cancel {
    background: #f3f4f6;
    color: #111;
}

.chat-long-memory-btn.confirm {
    background: #111;
    color: #fff;
}

.offline-style-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offline-style-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid #eee;
    background: #fff;
}

.offline-style-item-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.offline-style-delete-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.offline-style-delete-btn:active {
    opacity: 0.85;
}

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

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

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

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

.offline-style-new-header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.offline-style-new-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #222;
}

.offline-style-new-body {
    padding: 16px;
}

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

.offline-style-new-textarea:focus {
    outline: none;
    border-color: #07C160;
}

/* 作为 #app 直接子级时抬高层级，避免被聊天底栏(3000)/表情面板(3100)挡住 */
#app > .api-floating-ball {
    z-index: 3150;
}

.api-floating-ball {
    position: fixed;
    right: 18px;
    top: 112px;
    z-index: 2300;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,0.26);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(111, 132, 156, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px rgba(44, 62, 88, 0.24), inset 0 1px 0 rgba(255,255,255,0.18);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    opacity: 0.9;
    transition: opacity 0.28s ease, transform 0.2s ease, box-shadow 0.28s ease, backdrop-filter 0.28s ease, -webkit-backdrop-filter 0.28s ease, background 0.28s ease;
}

.api-floating-ball.show {
    display: flex;
}

.api-floating-ball.idle {
    opacity: 0.45;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background: rgba(111, 132, 156, 0.45);
    box-shadow: 0 8px 18px rgba(44, 62, 88, 0.12);
}

.api-floating-ball.dragging {
    transform: scale(1.04);
    box-shadow: 0 14px 28px rgba(44, 62, 88, 0.22);
}

.api-floating-ball:active {
    transform: scale(0.96);
}

.api-floating-ball.dragging:active {
    transform: scale(1.04);
}

.api-floating-ball-core {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255,255,255,0.68), rgba(218,232,244,0.22));
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.48), 0 0 0 1px rgba(255,255,255,0.12);
}

.api-floating-settings-modal-content {
    width: min(92vw, 368px);
    max-height: min(92vh, 640px);
    padding: 0;
    border: 1px solid rgba(216, 226, 238, 0.75);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(239, 245, 251, 0.96));
    box-shadow: 0 18px 44px rgba(58, 77, 106, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
}

.api-floating-settings-header {
    flex-shrink: 0;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(240, 246, 252, 0.95), rgba(232, 239, 247, 0.9));
    border-bottom: 1px solid rgba(211, 222, 235, 0.85);
}

.api-floating-settings-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: #324155;
}

.api-floating-settings-header-spacer {
    width: 36px;
    flex: 0 0 36px;
}

.api-floating-settings-body {
    padding: 14px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-floating-panel {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(216, 226, 238, 0.92);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.68);
}

.api-floating-panel-compact {
    padding-bottom: 10px;
}

.api-floating-panel-title {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #5a6b80;
    letter-spacing: 0.02em;
}

.api-floating-input {
    width: 100%;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(203, 216, 230, 0.95);
    background: rgba(248, 251, 255, 0.96);
    font-size: 13px;
    color: #334255;
}

.api-floating-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.api-floating-panel-row .api-floating-panel-title {
    margin-bottom: 0;
}

.api-floating-panel-models {
    padding-bottom: 10px;
}

/* 覆盖全局 .modal-footer { height: 50px }，否则底部按钮被硬性裁切 */
.api-floating-settings-footer.modal-footer,
.api-floating-settings-footer {
    height: auto;
    min-height: 0;
    align-items: stretch;
    flex-shrink: 0;
    /* 底部留白大于圆角 + 安全区，避免父级 overflow:hidden 裁切 */
    padding: 12px 14px calc(26px + env(safe-area-inset-bottom, 0px));
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(211, 222, 235, 0.75);
    background: rgba(245, 249, 253, 0.94);
    border-radius: 0 0 20px 20px;
    box-sizing: border-box;
}

.api-floating-settings-footer .btn-cancel,
.api-floating-settings-footer .btn-save {
    flex: 1 1 0;
    border-radius: 12px;
    min-height: 44px;
    padding: 10px 12px;
    box-sizing: border-box;
    line-height: 1.3;
}

.floating-fetch-models-btn {
    width: auto;
    min-width: 110px;
    margin-top: 0;
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 12px;
}

.floating-models-list {
    max-height: 160px;
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(244, 248, 252, 0.84);
}

.floating-models-list .model-item {
    padding: 10px 12px;
    font-size: 13px;
}

@media (max-width: 420px) {
    .api-floating-ball {
        width: 42px;
        height: 42px;
    }

    .api-floating-ball-core {
        width: 16px;
        height: 16px;
    }

    .api-floating-settings-modal-content {
        width: calc(100vw - 24px);
    }
}

@media (max-height: 720px) {
    .api-floating-settings-modal-content {
        max-height: min(94vh, 600px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .api-floating-ball {
        transition: opacity 0.01s linear;
    }
}

/* 线下模式悬浮按钮：坐标由 updateOfflineFloatingButtonForCurrentChat 写入（position:fixed），
   并夹紧在 #app 手机屏幕框内；勿用整窗 window 作为边界，否则宽屏下会出现在框外 */
.offline-float-btn {
    position: fixed;
    right: 10px;
    top: 110px;
    z-index: 2100;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 16px;
    background: transparent;
    padding: 0;
    box-shadow: 0 10px 26px rgba(0,0,0,0.18);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* 便于拖拽 */
}

.offline-float-btn-img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    filter: saturate(1.04) contrast(1.02);
}

.offline-float-btn:active {
    transform: scale(0.98);
}

.offline-float-btn.dragging {
    opacity: 0.9;
    box-shadow: 0 12px 30px rgba(0,0,0,0.22);
}

.location-modal-content {
    width: 320px;
    max-width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    overflow: hidden;
}

.location-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.location-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.location-modal-body {
    padding: 20px;
}

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

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

.location-form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.location-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.location-input:focus {
    outline: none;
    border-color: #07C160;
}

.location-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.location-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

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

.location-confirm-btn {
    background: #07C160;
    color: white;
}

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

/* 位置消息气泡 - 线性地图风格（PANTONE 11-4201TCX / #A9A9A7 / #FBF7EC / #6B7473） */
.chat-location-bubble {
    display: flex;
    flex-direction: column;
    max-width: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: #FBF7EC;
    box-shadow: inset 0 0 0 1px rgba(107, 116, 115, 0.12);
}

.chat-location-map {
    width: 100%;
    height: 112px;
    background: #FBF7EC;
    position: relative;
    overflow: hidden;
}

.chat-location-map svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-location-map-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 26px;
    filter: drop-shadow(0 1px 1px rgba(107, 116, 115, 0.24));
}

.chat-location-map-pin svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-location-info {
    padding: 10px 12px 8px;
    background: #F0EEE9;
    border-top: 1px solid rgba(107, 116, 115, 0.22);
}

.chat-location-place {
    font-size: 15px;
    font-weight: 700;
    color: #6B7473;
    margin-bottom: 2px;
}

.chat-location-address {
    font-size: 12px;
    color: #A9A9A7;
    line-height: 1.35;
}

.chat-location-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #6B7473;
    color: #FBF7EC;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    border-radius: 0 0 8px 8px;
}

.chat-location-footer-icon {
    width: 12px;
    height: 15px;
    flex-shrink: 0;
}

.chat-location-footer-icon path {
    fill: none;
    stroke: #FBF7EC;
    stroke-width: 1.2;
}

.photo-card-modal-hint {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.45;
}

.photo-card-textarea {
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
    box-sizing: border-box;
}

/* 描述型照片：拍立得外框 + 3D 翻面（须固定宽度，避免 fit-content + 子项 100% 在 flex 里塌成细条） */
.chat-message-bubble.chat-message-bubble--polaroid {
    overflow: visible;
    padding: 6px 8px !important;
    flex-shrink: 0;
    width: 244px;
    min-width: 244px;
    max-width: min(270px, calc(100% - 20px));
    box-sizing: border-box;
    align-items: stretch;
}


.chat-photo-flip-root {
    width: 228px;
    height: 324px;
    max-width: 100%;
    perspective: 920px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    margin: 0 auto;
    flex-shrink: 0;
}

.chat-photo-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.chat-photo-flip-root.is-flipped .chat-photo-flip-inner {
    transform: rotateY(180deg);
}

.chat-photo-face {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: visible;
    box-sizing: border-box;
}

.chat-photo-polaroid-frame {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fcfbf9;
    padding: 11px 11px 12px;
    border-radius: 2px;
    border: 1px solid rgba(230, 225, 215, 0.65);
    box-shadow:
        0 4px 12px rgba(170, 160, 140, 0.1),
        0 18px 36px rgba(170, 160, 140, 0.14);
    box-sizing: border-box;
    font-family: -apple-system, "PingFang SC", sans-serif;
}

.chat-photo-polaroid-imgarea {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 1px;
    overflow: hidden;
    box-sizing: border-box;
}

.chat-photo-polaroid-imgarea--back {
    background: linear-gradient(145deg, #d8d6d3 0%, #9c9a97 48%, #b5b3b0 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.chat-photo-polaroid-emulsion {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            -12deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 3px
        );
    pointer-events: none;
    opacity: 0.9;
}

.chat-photo-polaroid-imgarea--back::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 2px;
    border: 1px dashed rgba(60, 60, 60, 0.18);
    pointer-events: none;
    z-index: 1;
}

.chat-photo-polaroid-imgarea--front {
    background: linear-gradient(165deg, #faf8f5 0%, #ebe7e1 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04), inset 0 3px 10px rgba(0, 0, 0, 0.05);
}

.chat-photo-polaroid-chin {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-top: 8px;
}

.chat-photo-polaroid-chin--back {
    align-items: center;
    justify-content: flex-end;
}

.chat-photo-polaroid-brand {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 9px;
    letter-spacing: 2px;
    color: #b5b0a8;
    font-style: italic;
}

.chat-photo-polaroid-chin--front .chat-photo-polaroid-line {
    width: 16px;
    height: 1px;
    background: #c8c3bc;
    margin-bottom: 8px;
}

.chat-photo-polaroid-meta {
    font-family: "Georgia", "Times New Roman", serif;
    font-style: italic;
    font-size: 10px;
    color: #b5b0a8;
    letter-spacing: 0.8px;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.chat-photo-back-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(38, 38, 38, 0.92);
    text-align: center;
    padding: 12px 10px;
    height: 100%;
    box-sizing: border-box;
}

.chat-photo-back-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.chat-photo-back-hint {
    font-size: 11px;
    opacity: 0.82;
    line-height: 1.35;
    max-width: 11em;
}

.chat-photo-front {
    transform: rotateY(180deg);
}

.chat-photo-front-text {
    position: relative;
    z-index: 0;
    padding: 12px 11px;
    font-size: 13px;
    line-height: 1.65;
    font-weight: 300;
    color: #55504b;
    letter-spacing: 0.35px;
    text-align: justify;
    overflow-y: auto;
    width: 100%;
    height: 100%;
    max-height: 100%;
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
}

/* 转账消息气泡 */
.chat-transfer-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    min-width: 120px;
    max-width: 180px;
    border-radius: 10px;
    background: linear-gradient(135deg, #07C160 0%, #06AD56 100%);
    color: #fff;
}
.chat-transfer-label {
    font-size: 12px;
    opacity: 0.95;
    margin-bottom: 4px;
}
.chat-transfer-amount {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.chat-transfer-status {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 6px;
}
.chat-transfer-bubble.transfer-pending .chat-transfer-status { color: rgba(255,255,255,0.95); }
.chat-transfer-bubble.transfer-received .chat-transfer-status { color: rgba(255,255,255,0.9); }
.chat-transfer-bubble.transfer-rejected {
    background: linear-gradient(135deg, #8E8E93 0%, #636366 100%);
}
.chat-transfer-bubble.transfer-rejected .chat-transfer-status { color: rgba(255,255,255,0.85); }

/* 好友发给用户的转账（待收款样式，含附言+操作按钮） */
.chat-transfer-friend {
    min-width: 140px;
    max-width: 200px;
}
.chat-transfer-msg {
    font-size: 11px;
    opacity: 0.88;
    margin-top: 2px;
    margin-bottom: 4px;
    text-align: center;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-transfer-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}
.chat-transfer-action-btn {
    flex: 1;
    padding: 4px 0;
    border-radius: 14px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}
.chat-transfer-action-btn:active { opacity: 0.7; }
.chat-transfer-reject {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.chat-transfer-accept {
    background: rgba(255,255,255,0.9);
    color: #07C160;
    font-weight: 600;
}

/* 红包气泡 */
.chat-redpacket-bubble {
    background: linear-gradient(135deg, #E53835 0%, #C62828 100%);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 120px;
    max-width: 160px;
    text-align: center;
    color: #fff;
}
.chat-redpacket-friend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.chat-redpacket-inner {
    position: relative;
    width: 72px;
    height: 90px;
    background: linear-gradient(160deg, #FFD700 0%, #FFA000 60%, #E65100 100%);
    border-radius: 6px;
    border: 2px solid rgba(255,245,200,0.6);
    box-shadow: inset 0 2px 8px rgba(255,255,200,0.4), 0 2px 6px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto;
    overflow: hidden;
}
/* 红包封口装饰线 */
.chat-redpacket-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 4px;
    background: #C62828;
    border-radius: 0 0 4px 4px;
}
.chat-redpacket-open-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s;
    z-index: 1;
}
.chat-redpacket-open-btn:active { transform: scale(0.92); }
.chat-redpacket-open-text {
    font-size: 13px;
    font-weight: 700;
    color: #C62828;
    font-family: inherit;
}
.chat-redpacket-amount {
    font-size: 18px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-top: 2px;
}
.chat-redpacket-msg {
    font-size: 11px;
    opacity: 0.9;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* 购物礼盒消息气泡（INS 奶油风包裹 + 绑带） */
.chat-message-bubble--gift-bundle {
    max-width: 220px;
}

.chat-gift-bundle-card {
    position: relative;
    border-radius: 22px;
    padding: 18px 14px 14px;
    background: linear-gradient(165deg, #fff9f4 0%, #fdeee6 42%, #f8e4dc 100%);
    box-shadow:
        0 10px 28px rgba(232, 180, 160, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        inset 0 -1px 0 rgba(230, 160, 140, 0.12);
    border: 1px solid rgba(255, 230, 220, 0.95);
    overflow: hidden;
}

.chat-gift-bundle-ribbon {
    position: absolute;
    background: linear-gradient(180deg, #ffc9d8 0%, #f4a9c4 50%, #e98ba8 100%);
    box-shadow: 0 2px 8px rgba(200, 100, 130, 0.25);
    z-index: 1;
    pointer-events: none;
}

.chat-gift-bundle-ribbon--v {
    left: 50%;
    top: -4px;
    bottom: -4px;
    width: 22px;
    transform: translateX(-50%);
    border-radius: 6px;
}

.chat-gift-bundle-ribbon--h {
    top: 52%;
    left: -6px;
    right: -6px;
    height: 20px;
    transform: translateY(-50%);
    border-radius: 10px;
}

.chat-gift-bundle-bow-svg {
    position: absolute;
    left: 50%;
    top: 6px;
    width: 64px;
    height: 28px;
    transform: translateX(-50%);
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(200, 90, 120, 0.2));
    pointer-events: none;
}

.chat-gift-bundle-inner {
    position: relative;
    z-index: 3;
    text-align: center;
    padding-top: 22px;
}

.chat-gift-bundle-tag {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #c97b8f;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-gift-bundle-title {
    font-size: 15px;
    font-weight: 700;
    color: #5c4550;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chat-gift-bundle-meta {
    font-size: 11px;
    color: #9a7a86;
    line-height: 1.35;
}

.chat-gift-bundle-note {
    margin: 10px 0 0;
    font-size: 10px;
    color: rgba(140, 110, 120, 0.85);
    line-height: 1.4;
}

.chat-gift-bundle-status {
    margin-top: 10px;
    font-size: 11px;
    color: #b07a8f;
    font-weight: 500;
}

.chat-gift-bundle-receive {
    margin-top: 12px;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #5c3d48;
    background: linear-gradient(180deg, #fff 0%, #ffeef5 100%);
    box-shadow: 0 4px 14px rgba(200, 120, 150, 0.22), inset 0 1px 0 #fff;
    -webkit-tap-highlight-color: transparent;
}

.chat-gift-bundle-receive:active {
    opacity: 0.92;
    transform: scale(0.98);
}

/* 表情面板 */
.emoji-panel {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    display: none;
}

.emoji-panel.show {
    display: block;
}

.emoji-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.emoji-category {
    display: flex;
}

.emoji-category-item {
    padding: 5px 10px;
    margin-right: 10px;
    border-radius: 15px;
    font-size: 14px;
    cursor: pointer;
}

.emoji-category-item.active {
    background: black;
    color: white;
}

.emoji-category-add {
    width: 24px;
    height: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.emoji-category-add:hover {
    background: #f5f5f5;
    border-color: #999;
}

.emoji-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emoji-panel-manage {
    padding: 5px 10px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

.emoji-panel-delete {
    padding: 5px 10px;
    border: 1px solid #ff4d4f;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    color: #ff4d4f;
    border-radius: 4px;
}

.emoji-panel-delete:hover:not(:disabled) {
    background: #ff4d4f;
    color: #fff;
}

.emoji-panel-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.emoji-panel-content {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.emoji-panel-content.has-emoji-grid {
    align-items: flex-start;
    justify-content: flex-start;
}

.emoji-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.emoji-add-button {
    width: 100px;
    height: 100px;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    cursor: pointer;
}

.emoji-add-icon {
    font-size: 40px;
    color: #e0e0e0;
}

.emoji-empty-text {
    font-size: 14px;
    color: #999;
}

/* 表情网格 */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.emoji-item {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.emoji-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emoji-item.manage-mode-item {
    position: relative;
}

.emoji-item.manage-mode-item::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border: 2px solid #ccc;
    border-radius: 3px;
    background: rgba(255,255,255,0.9);
}

.emoji-item.manage-mode-item.selected {
    box-shadow: 0 0 0 2px #07C160;
}

.emoji-item.manage-mode-item.selected::after {
    background: #07C160;
    border-color: #07C160;
}

.emoji-item.emoji-add-item {
    border: 2px dashed #e0e0e0;
    background: #fafafa;
}

.emoji-item.emoji-add-item:hover {
    border-color: #07C160;
    background: #f0fff4;
}

.emoji-add-inline {
    font-size: 24px;
    color: #999;
}

.emoji-item.emoji-add-item:hover .emoji-add-inline {
    color: #07C160;
}

/* 聊天界面中的表情图片 */
.chat-emoji {
    max-width: 75px;
    max-height: 75px;
    width: auto;
    height: auto;
    vertical-align: middle;
    display: block;
    padding: 0;
    border: none;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

.chat-emoji-broken {
    opacity: 0.4;
    filter: grayscale(1);
    max-width: 75px;
    max-height: 75px;
}

/* 创建表情分组对话框 */
.create-emoji-category-modal {
    width: 280px;
    min-height: 200px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
}

.create-emoji-category-modal .modal-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.create-emoji-category-content {
    padding: 20px;
}

.create-emoji-category-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.create-emoji-category-content input:focus {
    border-color: #07C160;
}

.create-emoji-category-footer {
    display: flex;
    border-top: 1px solid #e0e0e0;
}

.create-emoji-category-cancel,
.create-emoji-category-confirm {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-emoji-category-cancel {
    color: #333;
    border-right: 1px solid #e0e0e0;
}

.create-emoji-category-cancel:hover {
    background: #f5f5f5;
}

.create-emoji-category-confirm {
    color: #07C160;
    font-weight: 500;
}

.create-emoji-category-confirm:hover {
    background: rgba(7, 193, 96, 0.05);
}

/* 添加表情对话框 */
.add-emoji-modal {
    width: 320px;
    min-height: 250px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
}

.add-emoji-modal .modal-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.add-emoji-content {
    padding: 20px;
}

.add-emoji-tip {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.add-emoji-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    resize: vertical;
    min-height: 100px;
}

.add-emoji-content textarea:focus {
    border-color: #07C160;
}

.add-emoji-footer {
    display: flex;
    border-top: 1px solid #e0e0e0;
}

.add-emoji-cancel,
.add-emoji-confirm {
    flex: 1;
    padding: 12px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-emoji-cancel {
    color: #333;
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
}

.add-emoji-cancel:hover {
    background: #e0e0e0;
}

.add-emoji-confirm {
    color: white;
    background: black;
    font-weight: 500;
}

.add-emoji-confirm:hover {
    background: #333;
}

.chat-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.chat-pat-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-pat-btn:hover {
    background-color: #e0e0e0;
}

.chat-send-btn {
    background: #07C160;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    background: #05a850;
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* API设置页面 */
#api-settings-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
}

#api-settings-page.active {
    display: flex;
}

#api-settings-page .settings-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f2f2f2;
}

/* 聊天背景设置模态框 */
.chat-background-modal .modal-body {
    padding: 20px;
}

.chat-background-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.background-preview {
    width: 100%;
    max-width: 300px;
    height: 400px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #f9f9f9;
}

.background-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.background-preview-placeholder:hover {
    background-color: #f0f0f0;
    border-color: #07C160;
}

.background-upload-hint {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.background-preview.has-background {
    border: 2px solid #07C160;
}

.background-preview.has-background .background-preview-placeholder {
    display: none;
}

.background-preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.background-actions {
    width: 100%;
    max-width: 300px;
}

.clear-background-btn {
    width: 100%;
    padding: 12px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-background-btn:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.clear-background-btn:active {
    background-color: #d0d0d0;
}

/* 错误弹框样式 */
.error-dialog-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* 高于情侣空间全屏层(≈200)、爱心外卖等，且作为 #app 子级时仍要在最上层 */
    z-index: 120000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px 16px;
    overflow-y: auto;
    box-sizing: border-box;
}

.error-dialog-container.show {
    opacity: 1;
    visibility: visible;
}

.error-dialog {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: auto;
    flex-shrink: 0;
}

.error-dialog-container.show .error-dialog {
    transform: scale(1);
}

.error-dialog-title {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #222;
    text-align: center;
    word-break: break-word;
}

.error-dialog-content {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 60vh;
    overflow-y: auto;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #eee;
}

.error-dialog-buttons {
    display: flex;
    gap: 10px;
}

.error-dialog-button {
    flex: 1;
    padding: 10px;
    background-color: #07C160;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.error-dialog-button:hover {
    background-color: #05a851;
}

.error-dialog-button:active {
    background-color: #049447;
}

.error-dialog-copy-btn {
    flex: 0 0 auto;
    padding: 10px 14px;
    background-color: #e8e8e8;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.error-dialog-copy-btn:hover {
    background-color: #d4d4d4;
}

/* 通用确认框（showConfirmDialog）：两钮等宽；danger=删除等破坏性操作 */
.confirm-dialog-buttons-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.confirm-dialog-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.confirm-dialog-btn-secondary {
    background-color: #e8e8e8;
    color: #333;
}

.confirm-dialog-btn-secondary:hover {
    background-color: #d8d8d8;
}

.confirm-dialog-btn-primary {
    background-color: #576b95;
    color: #fff;
}

.confirm-dialog-btn-primary:hover {
    background-color: #4a5d85;
}

.confirm-dialog-btn-danger {
    background-color: #e64340;
    color: #fff;
}

.confirm-dialog-btn-danger:hover {
    background-color: #cf3936;
}

.confirm-dialog-btn-danger:active,
.confirm-dialog-btn-primary:active,
.confirm-dialog-btn-secondary:active {
    opacity: 0.92;
}

/* 微信我页面 */
#wechat-me-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
}

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

/* 微信我页面内容区域 */

/* 编辑个人资料模态框 */
.edit-profile-modal {
    width: 320px;
    height: 400px;
    background: rgba(240, 240, 242, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

.edit-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
}

.edit-profile-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.edit-profile-body {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* 头像上传区域 */
.avatar-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar-container {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

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

.avatar-upload-hint {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 昵称编辑区域 */
.nickname-edit-section {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nickname-edit-section label {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.nickname-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.nickname-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

/* 底部按钮区域 */
.edit-profile-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
}

.cancel-btn, .save-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #f5f5f5;
    color: #333;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.save-btn {
    background: #000;
    color: #fff;
}

.save-btn:hover {
    background: #333;
}


/* 编辑个人资料模态框中的头像上传区域 */
#edit-profile-modal .avatar-upload-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

/* 我的人设模态框 */
#my-profile-modal .modal-content {
    width: 300px;
    min-height: 500px;
    background: rgba(240, 240, 242, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: height 0.3s ease;
}

#my-profile-modal .modal-content .my-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    height: 25px;
    box-sizing: border-box;
}

#my-profile-modal .modal-content .my-profile-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-left: 0;
    transform: none;
}

#my-profile-modal .modal-close {
    display: none;
}

#my-profile-modal .modal-content .my-profile-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 选择人设模态框 */
#select-persona-modal .modal-content {
    width: 200px;
    height: 280px;
    background: rgba(240, 240, 242, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

#select-persona-modal .select-persona-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#select-persona-modal .select-persona-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
    text-align: center;
}

/* 全局 .modal-close 为 display:none，此处必须显示否则人设列表为空时无法关闭 */
#select-persona-modal button.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 32px;
    min-height: 32px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

#select-persona-modal button.modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

#select-persona-modal .select-persona-body {
    padding: 20px;
    overflow-y: auto;
}

#select-persona-modal .persona-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#select-persona-modal .persona-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

#select-persona-modal .persona-item:hover {
    background: rgba(230, 230, 230, 0.8);
}

#select-persona-modal .empty-persona {
    font-size: 14px;
    color: #555;
    text-align: center;
}

#select-persona-modal .persona-empty-hint {
    font-size: 12px;
    color: #888;
    text-align: center;
    line-height: 1.5;
    margin-top: 10px;
}

/* 人设头像上传区域 */
#my-profile-modal .my-profile-avatar-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}

#my-profile-modal .my-profile-avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    cursor: pointer;
}

#my-profile-modal .my-profile-avatar-preview {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(0, 0, 0, 0.2);
    background-color: transparent;
}

#my-profile-modal .my-profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#my-profile-modal .my-profile-avatar-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* 人设编辑区域 */
#my-profile-modal .my-profile-edit-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#my-profile-modal .my-profile-edit-section label {
    font-size: 14px;
    color: #666;
}

#my-profile-modal .my-profile-input-container {
    position: relative;
    width: 100%;
}

#my-profile-modal .my-profile-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    min-height: 40px;
    max-height: 150px;
    resize: none;
    box-sizing: border-box;
}

#my-profile-modal .resizeable-textarea-container {
    position: relative;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    min-height: 100px;
    max-height: 250px;
    overflow: hidden;
}

#my-profile-modal .resizeable-textarea {
    width: 100%;
    height: 100%;
    min-height: 100px;
    min-width: 100%;
    max-width: 100%;
    max-height: 250px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f5f5f5;
    resize: none;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

#my-profile-modal .resizeable-textarea:focus {
    border-color: #ddd;
    box-shadow: none;
}

#my-profile-modal .resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #ccc;
    border-radius: 0 0 8px 0;
    cursor: nwse-resize;
    transition: all 0.2s ease;
    z-index: 10;
}

#my-profile-modal .resize-handle:hover {
    background-color: #999;
}

#my-profile-modal .resize-handle:active {
    background-color: #666;
}

#my-profile-modal .my-profile-input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
}

#my-profile-modal .my-profile-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 12px;
    height: 60px;
    box-sizing: border-box;
}

#my-profile-modal .my-profile-footer .cancel-btn, #my-profile-modal .my-profile-footer .save-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#my-profile-modal .my-profile-footer .cancel-btn {
    background-color: white;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

#my-profile-modal .my-profile-footer .save-btn {
    background-color: black;
    color: white;
}

#edit-profile-modal .avatar-upload-container {
    position: relative;
    width: 100px;
    height: 100px;
    cursor: pointer;
}

#edit-profile-modal .avatar-upload-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 2px dashed rgba(0, 0, 0, 0.2);
    background-color: transparent;
}

#edit-profile-modal .avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#edit-profile-modal .avatar-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.wechat-me-function-name {
    flex: 1;
    font-size: 16px;
}

.wechat-me-function-arrow {
    font-size: 16px;
    color: #999;
}

/* 微信发现页面 */
#wechat-discover-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
    position: relative;
}

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

/* 朋友圈打开：状态栏叠在封面上；隐藏「发现」标题与列表；底部 Tab 在朋友圈内不显示（否则 flex 会把它挤到顶部） */
#wechat-discover-page.wechat-discover-moments-open .wechat-me-header,
#wechat-discover-page.wechat-discover-moments-open .discover-content {
    display: none;
}

#wechat-discover-page.wechat-discover-moments-open .status-bar {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: relative;
    z-index: 200;
}

#wechat-discover-page.wechat-discover-moments-open .status-left {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

#wechat-discover-page.wechat-discover-moments-open .status-icon {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

/* 朋友圈封面（可能是用户上传图片）：图标改为白色并加阴影 */
#wechat-discover-page.wechat-discover-moments-open .status-right {
    color: #fff !important;
}

#wechat-discover-page.wechat-discover-moments-open .status-icon-svg {
    color: rgba(255, 255, 255, 0.95) !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

#wechat-discover-page.wechat-discover-moments-open .wechat-bottom-nav {
    display: none !important;
}

/* 情侣空间打开：与朋友圈一致，隐藏发现列表与底部 Tab，避免 flex 布局挤压 */
#wechat-discover-page.wechat-discover-couple-open .wechat-me-header,
#wechat-discover-page.wechat-discover-couple-open .discover-content {
    display: none;
}

#wechat-discover-page.wechat-discover-couple-open .wechat-bottom-nav {
    display: none !important;
}

/* ========== 微信-设置页（我 → 设置） ========== */

html.wechat-global-bg-on .discover-list {
    background: rgba(255, 255, 255, 0.55) !important;
}

html.wechat-global-bg-on .moments-page-body {
    background: transparent !important;
}

html.wechat-global-bg-on .moments-page {
    background: transparent !important;
}

html.wechat-global-bg-on #wechat-discover-page.wechat-discover-moments-open .status-bar {
    background: transparent !important;
}

html.wechat-global-bg-on .moments-feed-container {
    background: transparent !important;
}

html.wechat-global-bg-on .moments-post-card {
    background: rgba(244, 244, 244, 0.55) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

/* 全局字体（微信-设置）：外链 TTF 在 wechat-ui-settings.js 中带 unicode-range（U+0000-2FFF）防缺字；内置 /assets/FangZhengKaiTiJianTi-1.ttf 覆盖中英文 */
html.wechat-global-font-on #app {
    font-family: 'WechatUserGlobalFont', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
}

/* ========== 手机 App：好友列表 / 锁屏 / iOS 桌面 ========== */
#phone-page {
    background: #f2f2f7;
}

/* 手机页顶栏：取代原独立状态栏，与推特顶栏同为三栏网格 + 安全区 */
#phone-page > .phone-app-unified-header {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    padding: max(10px, env(safe-area-inset-top, 0px)) 12px 10px;
    flex-shrink: 0;
}

#phone-page > .phone-app-unified-header h1 {
    grid-column: 2;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    justify-self: center;
    width: 100%;
    max-width: 100%;
    flex: none;
}

#phone-page .phone-app-unified-back {
    grid-column: 1;
    justify-self: start;
    width: auto;
    min-width: 36px;
}

#phone-page .phone-page-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

/* 刷新在好友手机各应用页（微信/购物/视频/通话/资产）顶栏右侧显示；桌面与列表等视图隐藏 */
#phone-page .phone-page-refresh-btn.phone-page-refresh-hidden {
    visibility: hidden;
    pointer-events: none;
}

#phone-page .phone-page-right-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
}

#phone-page .phone-page-right-actions[aria-hidden="true"] {
    visibility: hidden;
    pointer-events: none;
}

#phone-page .phone-page-refresh-hidden {
    visibility: hidden;
    pointer-events: none;
}

#phone-page .phone-page-plus-btn {
    width: 34px;
    height: 34px;
    line-height: 1;
    font-weight: 700;
    font-size: 20px;
}

#phone-page .phone-page-refresh-btn.refreshing svg {
    animation: phone-refresh-spin 0.8s linear infinite;
}

@keyframes phone-refresh-spin {
    to { transform: rotate(360deg); }
}

#phone-page .phone-app-root {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* 暗网：隐藏外层「< 暗网」系统顶栏，由应用内「暗网论坛」顶栏贴顶展示 */
#phone-page.phone-page-darkweb-fullbleed > .phone-app-unified-header {
    display: none;
}

#phone-page.phone-page-darkweb-fullbleed .phone-app-root {
    flex: 1;
    min-height: 0;
}

#phone-page.phone-page-darkweb-fullbleed .phone-friend-app-inner {
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-bottom: 12px;
}

/* 好友锁屏 / 桌面：PANTONE 13-4306 TCX Ice Melt 色系近似 + 磨砂层次 */
.phone-friend-ice-wallpaper {
    background-color: #d3dde8;
    background-image: linear-gradient(165deg, #e8f0f7 0%, #cfd9e6 42%, #b9cad8 100%);
    background-size: cover;
    background-position: center;
}

.phone-view {
    display: none;
    flex-direction: column;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.phone-view.phone-view-active {
    display: flex;
}

/* 好友手机内置应用视图（微信/购物/视频/通话） */
.phone-friend-app-view {
    background: #f2f2f7;
}

.phone-friend-app-view .phone-friend-app-wallpaper,
.phone-friend-app-view .phone-friend-app-scrim {
    position: absolute;
    inset: 0;
}

.phone-friend-app-view .phone-friend-app-scrim {
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(12px);
}

.phone-friend-app-inner {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: 12px 14px 18px;
    overflow: hidden;
}

.phone-friend-app-body {
    height: 100%;
    overflow: auto;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 36px rgba(20, 20, 40, 0.08);
    padding: 14px;
}

/* 暗网：外层容器若出现竖条滚动条，一并隐藏（主滚动在 .friend-darkweb-feed 内） */
#phone-friend-app-body:has(> .friend-darkweb-shell) {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#phone-friend-app-body:has(> .friend-darkweb-shell)::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

.friend-app-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 4px 0 10px;
}

.friend-app-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friend-app-rowbtn {
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    font: inherit;
}

.friend-app-rowbtn:active {
    transform: translateY(1px);
    opacity: 0.92;
}

.friend-app-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.friend-app-row-title {
    font-size: 14px;
    font-weight: 650;
    color: #1c1c1e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-app-row-sub {
    font-size: 12px;
    color: #8e8e93;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-app-row-sub.friend-app-hint-multiline {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.45;
}

.friend-app-row-sub.friend-app-hint-detail {
    margin-top: 8px;
    font-size: 11px;
    color: #aeaeb2;
}

.friend-app-video-empty code {
    font-size: 0.95em;
    padding: 0 3px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}

.friend-app-backline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
}

.friend-app-mini-back {
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
}

.friend-app-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.friend-app-cardbtn {
    border: none;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    font: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 108px;
}

.friend-app-cardbtn:active {
    transform: translateY(1px);
    opacity: 0.92;
}

.friend-app-thumb {
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(88, 86, 214, 0.25), rgba(52, 199, 89, 0.18));
}

.friend-app-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.friend-app-tag {
    font-size: 11px;
    color: #333;
    background: rgba(0, 0, 0, 0.06);
    padding: 3px 8px;
    border-radius: 999px;
}

.friend-app-detail {
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 13px;
    color: #333;
    /* 内容过长时不撑爆小屏：在好友手机应用页内独立滚动 */
    max-height: min(46vh, 340px);
    overflow: auto;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.03);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    word-break: break-word;
}

/* ========== 好友手机：资产（简洁卡片/分组容器） ========== */
.friend-assets-stack {
    display: flex;
    flex-direction: column;
    gap: 5px; /* 三个板块之间保持 5px */
}

.friend-assets-panel {
    background: rgba(255, 255, 255, 0.68);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 24px rgba(20, 20, 40, 0.06);
}

.friend-assets-panel-title {
    font-size: 14px;
    font-weight: 750;
    color: #1c1c1e;
    margin: 0 0 10px;
}

.friend-assets-bankcard {
    border-radius: 18px;
    padding: 14px 14px 12px;
    color: #fff;
    background: linear-gradient(145deg, rgba(34, 34, 44, 0.92), rgba(88, 95, 120, 0.88));
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
    position: relative;
    overflow: hidden;
}

.friend-assets-bankcard::before {
    content: "";
    position: absolute;
    inset: -40px -60px auto auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.22), rgba(255,255,255,0) 60%);
    transform: rotate(10deg);
}

.friend-assets-bankcard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.friend-assets-bankname {
    font-size: 13px;
    font-weight: 650;
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72%;
}

.friend-assets-chip {
    width: 34px;
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(145deg, rgba(255, 214, 102, 0.95), rgba(255, 168, 75, 0.9));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    flex: 0 0 auto;
}

.friend-assets-cardno {
    margin-top: 14px;
    font-size: 14px;
    letter-spacing: 1.6px;
    font-variant-numeric: tabular-nums;
    opacity: 0.92;
    position: relative;
    z-index: 1;
}

.friend-assets-balance {
    margin-top: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-variant-numeric: tabular-nums;
    position: relative;
    z-index: 1;
}

.friend-assets-currency {
    font-size: 12px;
    opacity: 0.9;
}

.friend-assets-balance-num {
    font-size: 20px;
    font-weight: 800;
}

.friend-assets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friend-assets-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.75);
}

.friend-assets-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friend-assets-item-title {
    font-size: 14px;
    font-weight: 650;
    color: #1c1c1e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.friend-assets-item-sub {
    font-size: 12px;
    color: #8e8e93;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.friend-assets-amt {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.friend-assets-profit {
    color: #1f8a3b; /* 绿色：收益 */
}

.friend-assets-loss {
    color: #d63a2f; /* 红色：亏损/支出 */
}

.phone-menu-hint {
    margin: 8px 18px 4px;
    font-size: 13px;
    color: #8e8e93;
    text-align: center;
}

.phone-friends-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 10px;
    align-content: start;
}

@media (max-width: 360px) {
    .phone-friends-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.phone-friend-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 12px;
    transition: background 0.2s ease;
    border: none;
    background: transparent;
    font: inherit;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
}

.phone-friend-tile:active {
    background: rgba(0, 0, 0, 0.06);
}

.phone-friend-tile-av {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e5ea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.phone-friend-tile-av.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: #8e8e93;
}

.phone-friend-tile-name {
    font-size: 11px;
    color: #3a3a3c;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.phone-friends-empty {
    text-align: center;
    padding: 40px 24px;
    color: #8e8e93;
    font-size: 14px;
}

/* 锁屏（浅色 Ice Melt 磨砂底） */
.phone-lock-view {
    color: #243141;
    user-select: none;
}

.phone-lock-wallpaper {
    position: absolute;
    inset: 0;
    transform: none;
}

.phone-lock-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.32) 45%, rgba(210, 224, 236, 0.4) 100%);
    backdrop-filter: blur(18px) saturate(118%);
    -webkit-backdrop-filter: blur(18px) saturate(118%);
}

.phone-lock-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 20px 28px;
    min-height: 0;
}

.phone-lock-datetime {
    text-align: center;
    margin-bottom: 28px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

.phone-lock-time-lg {
    font-size: 68px;
    font-weight: 200;
    letter-spacing: -2px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #172433;
}

.phone-lock-date {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 400;
    color: #3d5266;
    opacity: 1;
}

.phone-lock-hint {
    font-size: 15px;
    margin: 0 0 16px;
    opacity: 1;
    color: #2c4054;
    text-align: center;
    max-width: 92%;
    line-height: 1.45;
}

.phone-lock-dots {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}

.phone-lock-pin-refresh-countdown {
    font-size: 13px;
    color: #2f4a62;
    margin: 0 0 8px;
    min-height: 22px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    max-width: 96%;
}

.phone-lock-pin-refresh-countdown.phone-lock-countdown-wait {
    font-size: 12px;
    opacity: 0.9;
}

.phone-lock-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(30, 48, 64, 0.42);
    background: transparent;
    transition: background 0.15s ease;
}

.phone-lock-dot.filled {
    background: #1e3040;
}

.phone-lock-attempts {
    min-height: 20px;
    font-size: 13px;
    color: #c0392b;
    margin: 0 0 6px;
}

.phone-lock-keypad {
    margin-top: auto;
    width: 100%;
    max-width: 320px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 18px;
    padding-bottom: 8px;
}

.phone-lock-key {
    height: 72px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.48);
    color: #1e3040;
    font-size: 26px;
    font-weight: 300;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.15s ease, transform 0.1s ease;
}

.phone-lock-key:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.72);
}

.phone-lock-key.phone-lock-key-muted {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.phone-lock-key.phone-lock-key-delete {
    font-size: 15px;
    font-weight: 500;
}

.phone-lock-key.phone-lock-key-back {
    font-size: 15px;
    font-weight: 500;
    border-radius: 50%;
}

.phone-lock-view.shake {
    animation: phone-lock-shake 0.42s ease;
}

@keyframes phone-lock-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* 桌面 */
.phone-desktop-view {
    color: #1e3040;
    user-select: none;
}

.phone-desktop-wallpaper {
    position: absolute;
    inset: 0;
    transform: none;
    filter: none;
}

.phone-desktop-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.28) 50%, rgba(208, 222, 234, 0.38) 100%);
    backdrop-filter: blur(20px) saturate(118%);
    -webkit-backdrop-filter: blur(20px) saturate(118%);
}

.phone-desktop-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 0 0;
    min-height: 0;
    overflow-y: auto;
}

/* 好友手机桌面顶部 + 占位键（后续：导出/导入好友手机数据） */
.phone-desktop-top-actions {
    position: sticky;
    top: 10px;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 0 18px;
    box-sizing: border-box;
    pointer-events: none;
}

.phone-desktop-plus-btn {
    pointer-events: auto;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    color: #1e3040;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.phone-desktop-plus-btn:active {
    transform: translateY(1px);
    opacity: 0.9;
}

/* 与主屏幕 .main-card 同规格（外边距由 .main-card 自带 16px 与首页一致） */
.phone-friend-desktop-card.main-card {
    flex-shrink: 0;
    margin: 18px 16px 20px;
    width: calc(100% - 32px);
    max-width: none;
    box-sizing: border-box;
    align-self: center;
}

.phone-friend-card-bg {
    pointer-events: none;
    cursor: default;
}

.phone-friend-desktop-avatar-frame {
    cursor: default;
}

.phone-friend-desktop-avatar-frame .avatar-image {
    pointer-events: none;
}

.phone-friend-card-name {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #2d2d2d;
    width: 100%;
    line-height: 1.3;
}

.phone-friend-card-icons {
    pointer-events: none;
    opacity: 0.85;
}

.phone-friend-card-signature p {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.phone-desktop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px 16px;
    max-width: 340px;
    width: 100%;
    align-self: center;
    margin-top: auto;
    margin-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    margin-left: auto;
    margin-right: auto;
}

.phone-desktop-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 4px;
    color: inherit;
    font: inherit;
}

.phone-desktop-app:active {
    opacity: 0.85;
}

.phone-desktop-app-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.phone-desktop-app-label {
    font-size: 11px;
    font-weight: 500;
    color: #2c3e50;
    text-shadow: none;
    text-align: center;
    max-width: 72px;
    line-height: 1.2;
}

/* Char 手机桌面：韩式极简配色与按钮质感 */
.phone-desktop-view {
    color: #3d4a5c;
    font-weight: 300;
    letter-spacing: 0.01em;
}

.phone-friend-ice-wallpaper {
    background-color: #faf9f7;
    background-image:
        radial-gradient(circle at 12% 12%, rgba(212, 165, 165, 0.24), rgba(212, 165, 165, 0) 30%),
        radial-gradient(circle at 86% 24%, rgba(168, 197, 184, 0.22), rgba(168, 197, 184, 0) 28%),
        linear-gradient(155deg, #faf9f7 0%, #f4f0ec 52%, #eef3ef 100%);
}

.phone-desktop-scrim {
    background: linear-gradient(180deg, rgba(250, 249, 247, 0.62) 0%, rgba(250, 249, 247, 0.36) 52%, rgba(212, 165, 165, 0.12) 100%);
    backdrop-filter: blur(18px) saturate(108%);
    -webkit-backdrop-filter: blur(18px) saturate(108%);
}

.phone-desktop-plus-btn {
    border-radius: 999px;
    border: 1px solid rgba(61, 74, 92, 0.12);
    background: rgba(250, 249, 247, 0.82);
    box-shadow: 0 8px 24px rgba(61, 74, 92, 0.08);
    color: #3d4a5c;
    font-size: 18px;
    font-weight: 300;
    transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
}

.phone-desktop-plus-btn:hover {
    opacity: 0.82;
    box-shadow: 0 4px 12px rgba(61, 74, 92, 0.06);
}

.phone-desktop-plus-btn.phone-desktop-plus-busy {
    pointer-events: none;
    opacity: 1;
    animation: phone-desktop-refresh-twinkle 0.78s ease-in-out infinite;
}

@keyframes phone-desktop-refresh-twinkle {
    0%,
    100% {
        transform: scale(1);
        background: rgba(250, 249, 247, 0.82);
        box-shadow: 0 8px 24px rgba(61, 74, 92, 0.08);
    }
    50% {
        transform: scale(1.08);
        background: rgba(212, 165, 165, 0.28);
        box-shadow: 0 0 0 6px rgba(212, 165, 165, 0.14), 0 8px 24px rgba(61, 74, 92, 0.08);
    }
}

.phone-friend-desktop-card.main-card {
    border: 1px solid rgba(61, 74, 92, 0.1);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(250, 249, 247, 0.9), rgba(212, 165, 165, 0.08));
    box-shadow: 0 8px 24px rgba(61, 74, 92, 0.08);
    overflow: hidden;
}

.phone-friend-desktop-card .card-background,
.phone-friend-card-bg {
    background:
        radial-gradient(circle at 30% 12%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 36%),
        linear-gradient(145deg, rgba(250, 249, 247, 0.94), rgba(212, 165, 165, 0.08));
}

.phone-friend-desktop-avatar-frame {
    border: 1px solid rgba(61, 74, 92, 0.1);
    box-shadow: 0 4px 12px rgba(61, 74, 92, 0.06);
}

.phone-friend-card-name {
    color: #3d4a5c;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.phone-friend-card-icons {
    color: rgba(212, 165, 165, 0.72);
    opacity: 0.9;
}

.phone-friend-card-signature p {
    color: rgba(61, 74, 92, 0.86);
    font-weight: 300;
    letter-spacing: 0.03em;
}

.phone-desktop-grid {
    gap: 18px 14px;
    max-width: 328px;
}

.phone-desktop-app {
    gap: 8px;
    padding: 8px 4px;
    border-radius: 22px;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.phone-desktop-app:active {
    transform: translateY(1px);
    opacity: 0.82;
}

.phone-desktop-app-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    border: 1px solid rgba(61, 74, 92, 0.1);
    background: #faf9f7;
    color: #3d4a5c;
    box-shadow: 0 4px 12px rgba(61, 74, 92, 0.06);
    font-size: 23px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.phone-desktop-app:nth-child(1) .phone-desktop-app-icon {
    background: linear-gradient(145deg, rgba(168, 197, 184, 0.24), rgba(250, 249, 247, 0.96));
}

.phone-desktop-app:nth-child(2) .phone-desktop-app-icon {
    background: linear-gradient(145deg, rgba(212, 165, 165, 0.22), rgba(250, 249, 247, 0.96));
}

.phone-desktop-app:nth-child(3) .phone-desktop-app-icon {
    background: linear-gradient(145deg, rgba(198, 206, 220, 0.26), rgba(250, 249, 247, 0.96));
}

.phone-desktop-app:nth-child(4) .phone-desktop-app-icon {
    background: linear-gradient(145deg, rgba(61, 74, 92, 0.12), rgba(250, 249, 247, 0.96));
}

.phone-desktop-app:nth-child(5) .phone-desktop-app-icon {
    background: linear-gradient(145deg, rgba(226, 205, 160, 0.24), rgba(250, 249, 247, 0.96));
}

.phone-desktop-app:nth-child(6) .phone-desktop-app-icon {
    background: linear-gradient(145deg, rgba(168, 197, 184, 0.2), rgba(212, 165, 165, 0.08));
}

.phone-desktop-app-label {
    color: #3d4a5c;
    font-weight: 300;
    letter-spacing: 0.04em;
}

.phone-desktop-refresh-modal {
    z-index: 1200;
}

.phone-desktop-refresh-card {
    width: min(88vw, 360px);
    padding: 0;
    border-radius: 28px;
    border: 1px solid rgba(61, 74, 92, 0.1);
    background: rgba(250, 249, 247, 0.96);
    box-shadow: 0 8px 24px rgba(61, 74, 92, 0.08);
    overflow: hidden;
}

.phone-desktop-refresh-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 14px;
}

.phone-desktop-refresh-head h3 {
    margin: 0;
    color: #3d4a5c;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.phone-desktop-refresh-head p {
    margin: 6px 0 0;
    color: rgba(61, 74, 92, 0.58);
    font-size: 12px;
    line-height: 1.45;
}

.phone-desktop-refresh-close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(61, 74, 92, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    color: #3d4a5c;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.phone-desktop-refresh-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 18px 18px;
}

.phone-desktop-refresh-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(61, 74, 92, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.48);
    cursor: pointer;
    transition: opacity 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.phone-desktop-refresh-option:has(input:checked) {
    border-color: rgba(212, 165, 165, 0.3);
    background: rgba(212, 165, 165, 0.12);
}

.phone-desktop-refresh-option:hover {
    opacity: 0.84;
}

.phone-desktop-refresh-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.phone-desktop-refresh-check {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(61, 74, 92, 0.22);
    background: #faf9f7;
    box-shadow: inset 0 0 0 4px #faf9f7;
    flex: 0 0 auto;
}

.phone-desktop-refresh-option input:checked + .phone-desktop-refresh-check {
    background: #3d4a5c;
}

.phone-desktop-refresh-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.phone-desktop-refresh-copy strong {
    color: #3d4a5c;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.04em;
}

.phone-desktop-refresh-copy small {
    color: rgba(61, 74, 92, 0.58);
    font-size: 11px;
    line-height: 1.35;
}

.phone-desktop-refresh-foot {
    display: flex;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(61, 74, 92, 0.08);
}

.phone-desktop-refresh-secondary,
.phone-desktop-refresh-primary {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(61, 74, 92, 0.16);
    padding: 11px 14px;
    font: inherit;
    font-weight: 300;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: opacity 0.22s ease, box-shadow 0.22s ease;
}

.phone-desktop-refresh-secondary {
    background: transparent;
    color: #3d4a5c;
}

.phone-desktop-refresh-primary {
    background: #3d4a5c;
    border-color: #3d4a5c;
    color: #faf9f7;
}

.phone-desktop-refresh-secondary:hover,
.phone-desktop-refresh-primary:hover {
    opacity: 0.82;
    box-shadow: 0 4px 12px rgba(61, 74, 92, 0.06);
}
