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

html {
    /* 避免移动端 100vh 包含地址栏导致溢出 */
    height: 100%;
    -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 */
}

/* 背景气泡效果 */
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;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    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;
    /* 适配刘海屏安全区域 */
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* 响应式设置 */
@media (min-width: 481px) {
    #app {
        border-radius: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
        min-height: calc(100vh - 40px);
        min-height: calc(100dvh - 40px);
        max-height: calc(100vh - 40px);
        max-height: calc(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;
}

.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: #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: 1;
}

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

.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;
}

/* 推文详情页 */
.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 {
    font-size: 17px;
    font-weight: 700;
    color: #000;
}
.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;
}

/* 评论区 */
.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;
}

/* 主屏幕可滚动区域：小屏时允许滚动，避免内容被截断 */
.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;
    word-break: break-word;
    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;
}

/* 模态框样式 */
/* 设置页面样式 */
#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: #f8f8f8;
}

.books-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

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

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

.books-header-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

.books-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
}

.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;
    padding: 48px 24px;
    text-align: center;
}

.world-book-empty-icon {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 16px;
}

.world-book-empty-text {
    font-size: 16px;
    color: #888;
    margin-bottom: 8px;
}

.world-book-empty-hint {
    font-size: 14px;
    color: #aaa;
}

.world-book-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.world-book-item-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

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

.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: 120px;
    resize: vertical;
}

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

.world-book-folder-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: #f8f8f8;
}

.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    line-height: 1.4;
}

/* 新建文件夹模态框 */
#new-folder-modal .modal-content.new-folder-modal-content {
    border: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

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

.new-folder-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0;
}

.new-folder-input {
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    background: #f0f0f0;
    color: #333;
}

.new-folder-input::placeholder {
    color: #999;
}

.new-folder-buttons {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.new-folder-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-folder-btn.cancel {
    background: #e8e8e8;
    color: #555;
}

.new-folder-btn.cancel:hover {
    background: #ddd;
}

.new-folder-btn.create {
    background: #000;
    color: #fff;
}

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

/* 世界书分组列表 */
.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;
}

.preset-btn {
    flex: 1;
    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);
}

.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;
}

.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;
}

.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;
}

.status-indicator.connecting {
    background-color: #faad14;
    animation: pulse 1.5s infinite;
}

.status-indicator.connected {
    background-color: #52c41a;
}

@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);
}

.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-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
}

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

.wechat-header {
    display: flex;
    align-items: center;
    padding: 12px 8px; /* 缩小5px */
    background: rgba(191, 189, 195, 0.35); /* #PANTONE 663 C with 35% opacity */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

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

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

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

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

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

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

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

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

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

.wechat-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: rgba(250, 250, 250, 0.65); /* #RAL 9003 with 65% opacity */
}

/* 底部导航栏 */
.wechat-bottom-nav {
    display: flex;
    flex-shrink: 0;
    background: rgba(191, 189, 195, 0.35); /* #PANTONE 663 C with 35% opacity */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

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

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

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

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

.wechat-nav-text {
    font-size: 12px;
    color: #666;
    transition: color 0.3s ease;
    display: none; /* 隐藏文字元素 */
}

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

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

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

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

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

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

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

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

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

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

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

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

/* 聊天页面样式 */
#chat-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
    position: relative;
}

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

.chat-header {
    display: flex;
    align-items: center;
    padding: 12px 11px;
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
}

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

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

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

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

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

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

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

/* 心跳监控：顶部栏 <details>，与聊天设置按钮同排 */
.chat-heartbeat-monitor {
    position: relative;
    list-style: none;
}

.chat-heartbeat-monitor-summary {
    list-style: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
}

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

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

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

.chat-heartbeat-monitor-icon {
    width: 30px;
    height: 30px;
    display: block;
    flex-shrink: 0;
}

/* 内联 SVG 心电图描线动画（避免外部 .svg 编码/路径导致裂图） */
.chat-heartbeat-monitor-icon .hb-ecg-line {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: chat-heartbeat-ecg 1.5s ease-in-out infinite;
}

@keyframes chat-heartbeat-ecg {
    0% { stroke-dashoffset: 60; }
    15% { stroke-dashoffset: 60; }
    30% { stroke-dashoffset: 0; }
    60% { stroke-dashoffset: 0; }
    75% { stroke-dashoffset: 60; }
    100% { stroke-dashoffset: 60; }
}

.chat-heartbeat-monitor[open] .chat-heartbeat-monitor-icon {
    /* 展开时可加一点视觉反馈，这里让图标微微放大 */
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

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

.chat-heartbeat-monitor-inner {
    /* 约 75% 不透明，减轻与聊天气泡叠字；底色保留淡粉倾向 */
    background-color: rgba(255, 245, 242, 0.75);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
    border-left: 3px solid #e74c3c; /* 红色强调（RAL 320 心红） */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

/* 心跳监控报告 · API 返回 HTML 渲染区 */
.heartbeat-report {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
}

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

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

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

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

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

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

.chat-content {
    flex: 1;
    min-height: 0; /* 关键：flex 子项默认可「撑开」导致无法正确滚动到底，见 #chat-page 列布局 */
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

/* 消息时间戳 */
.chat-message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    /* 占满头像旁剩余宽度，否则 max-width:80% 会相对过窄的父级计算，短句也会被强制换行 */
    flex: 1 1 0%;
    min-width: 0;
}

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

/* 群聊：成员昵称（显示在气泡上方，类似微信） */
.chat-message-name {
    font-size: 12px;
    color: #8a8a8a;
    line-height: 1.1;
    margin-left: 8px;
    margin-top: 2px;
    margin-bottom: -2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

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

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

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

/* 消息操作界面 */
.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;
}

/* 引用框架样式 */
.chat-quote-frame {
    display: none;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 15px;
    font-size: 14px;
}

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

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

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

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

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

.chat-quote-content {
    color: #666;
    line-height: 1.4;
    word-break: break-word;
}

/* 消息中的引用样式 */
.chat-message-quote {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    border-left: 3px solid #07C160;
}

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

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

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

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

.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);
}

/* 亲属卡界面 */
.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;
}

/* 与 .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-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;
    padding: 12px 16px;
    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);
}

.chat-function-btn {
    width: 36px;
    height: 36px;
    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;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    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);
}

/* 查找聊天记录模态框样式 */
.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: 14px;
    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;
}

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

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

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

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

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

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

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

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

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

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

/* 删除并退出按钮 */
.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;
    align-items: flex-start;
}

.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);
}

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

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

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

/* 音色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;
}

/* 音色语言选择器样式 */
#fs-voice-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 {
    border-color: #07C160;
}

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

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

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

/* 保存按钮 */
.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;
}

/* 更多功能面板 - 磨砂玻璃质感 */
.chat-more-panel {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
    display: none;
    max-height: 280px;
    overflow-y: auto;
}

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

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

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

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

/* 更多面板打开时，聊天内容底部留出空间，确保最后一条消息不被遮挡 */
.chat-content.more-panel-open,
.chat-content.read-together-panel-open {
    padding-bottom: 280px;
}

/* 灵动岛打开时，聊天内容顶部留出空间 */
.chat-content.dynamic-island-open {
    padding-top: 56px;
}

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

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

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

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

/* 一起听 - iOS风格灵动岛 */
.chat-dynamic-island {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: none;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.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: 15px;
    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: 14px;
    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-summary-modal,
.chat-summary-prompt-picker-modal,
.chat-summary-prompt-create-modal {
    /* 必须高于长记忆界面（2260），否则会被遮住 */
    z-index: 2290;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* 长记忆管理（黑/灰/白/红 线性图标风） */
.chat-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: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid #eee;
    background: #fff;
    cursor: pointer;
}

.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: 14px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
}

.offline-style-new-textarea:focus {
    outline: none;
    border-color: #07C160;
}

/* 线下模式悬浮按钮 */
.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: 10px;
    overflow: hidden;
    background: #FBF7EC;
}

.chat-location-map {
    width: 100%;
    height: 110px;
    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: 18px;
    height: 24px;
}

.chat-location-map-pin svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-location-info {
    padding: 10px 12px 8px;
    background: #F0EEE9;
    border-top: 1px solid #A9A9A7;
}

.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.5px;
    border-radius: 0 0 9px 9px;
}

.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;
}

/* 规范③ HTML 拍立得（.art-vibe / .wechat-polaroid-wrap）同在气泡内时，避免被 flex 压扁 */
/* 聊天气泡默认 inline-flex + 横向会使「换行/空白」成匿名 flex 项，出现左侧空列；拍立得须纵向单列 */
.chat-message-bubble:has(.wechat-polaroid-wrap),
.chat-message-bubble:has(.art-vibe) {
    display: block !important;
    flex-shrink: 0;
    width: fit-content;
    max-width: min(280px, calc(100% - 16px));
    min-width: min(260px, calc(100% - 20px));
    overflow: visible;
    box-sizing: border-box;
}

/* JS 为拍立得气泡追加此类，不依赖 :has()（部分 WebView 不支持时仍能保持纵向单列布局） */
/* 使用 block 而非 inline-flex，避免默认 flex-direction:row 把子节点排成横条、出现「白条」占位 */
.chat-message-bubble.chat-message-bubble--polaroid-html {
    display: block !important;
    flex-shrink: 0;
    width: fit-content;
    max-width: min(280px, calc(100% - 16px));
    min-width: min(260px, calc(100% - 20px));
    overflow: visible;
    box-sizing: border-box;
}

/* 拍立得外圈聊天气泡：收紧内边距，减少顶部「白条」感（原 12px 灰底与拍立得米色对比明显） */
.chat-message.other-message .chat-message-bubble.chat-message-bubble--polaroid-html,
.chat-message.my-message .chat-message-bubble.chat-message-bubble--polaroid-html,
.chat-message.other-message .chat-message-bubble:has(.wechat-polaroid-wrap),
.chat-message.my-message .chat-message-bubble:has(.wechat-polaroid-wrap) {
    padding: 6px 10px !important;
}

.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;
    z-index: 9999;
    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;
}

/* 微信我页面 */
#wechat-me-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
}

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

/* 微信我页面内容区域 */
.wechat-me-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #f2f2f2;
    position: relative;
}

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

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

/* 个人信息区域 */
.wechat-me-header.hidden,
.wechat-me-profile.hidden,
.wechat-me-functions.hidden {
    display: none !important;
}

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

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

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

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

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

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

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

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

/* 编辑个人资料模态框 */
.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-me-functions {
    background-color: #fff;
}

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

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

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

/* 编辑个人资料模态框中的头像上传区域 */
#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: center;
    align-items: center;
    padding: 15px;
    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;
}

#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);
}

/* 人设头像上传区域 */
#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;
}

/* ========== 微信-设置页（我 → 设置） ========== */
.wechat-settings-page {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    background: #f2f2f2;
    z-index: 100;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* 聊天气泡预览：结构与聊天页一致，用户上传的 CSS 会同样作用在预览上 */
.wechat-settings-bubble-preview-host {
    background: #ededed;
    border-radius: 10px;
    padding: 10px 8px 12px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

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

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

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

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

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

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

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

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

/* 微信全局背景图：由 JS 将 background-image 写到各页（Blob URL，避免超长 Data URL 写入 CSS 变量失效） */
html.wechat-global-bg-on .wechat-chat-list {
    background: rgba(250, 250, 250, 0.5) !important;
}

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

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）：作用于整台小手机 #app 内文字 */
html.wechat-global-font-on #app {
    font-family: 'WechatUserGlobalFont', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
}