/**
 * Apps Styles - 暮聧聝茅聺藰膬聙聛盲藕聴莽聰聼膬聙聛膰聵聼茅聛聡盲赂聣盲赂艦App莽職聞莽啪聨暮聦聳膰聽藝暮藕聫
 */

/* ========== 🚨 全局遮罩层穿透规则（防止遮挡交互按钮）========== */
/* 确保所有隐藏的遮罩层不阻挡点击 */
/* 注意：红包弹窗(#modal-send-rp, #modal-rp-open, #rp-details-view)由原生JS的display控制，不依赖.active类 */
.music-panel-overlay:not(.active),
.custom-modal-overlay:not(.active),
.overlay-page:not(.open) {
    pointer-events: none !important;
}

/* 只有激活状态才阻挡点击 */
.music-panel-overlay.active,
.custom-modal-overlay.active,
.overlay-page.open {
    pointer-events: auto !important;
}

/* 语音录音遮罩层始终可交互（z-index: 9999） */
.voice-recording-overlay {
    pointer-events: auto !important;
}

/* ========== 暮聟膮盲艧扭暮聫聵茅聡聫 ========== */
:root {
    --app-bg: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); 
    --glass-bg: rgba(255, 255, 255, 0.65); 
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --primary-color: #2563eb;
    
    /* 莽藕聳膷啪聭茅膭木盲赂钮茅藰聵膷聣藳 */
    --persona-theme: #e84393; /* 暮聧聝茅聺藰-莽藳聣膷聣藳 */
    --being-theme: #00b894;   /* 盲藕聴莽聰聼-莽钮偶膷聣藳 */
    --char-theme: #6c5ce7;    /* 膰聵聼茅聛聡-莽麓扭膷聣藳 */
    --bg-color: #f8f9fa;
}

/* ========== 暮聟慕暮聫艁茅膭木茅聺藰膰聽藝暮藕聫 (暮聧聝茅聺藰/盲藕聴莽聰聼/膰聵聼茅聛聡) ========== */
.persons-page, .beings-page, .contact-page, .moments-page {
    background: var(--app-bg) !important;
    backdrop-filter: none !important;
    overflow: hidden !important;
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 暮陇麓茅聝篓 */
.persons-page .header,
.beings-page .header,
.contact-page .header,
.moments-page .header {
    padding: 50px 24px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.persons-page .header-title,
.beings-page .header-title,
.contact-page .header-title,
.moments-page .header-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.persons-page .header-actions,
.beings-page .header-actions,
.contact-page .header-actions,
.moments-page .header-actions {
    display: flex;
    gap: 12px;
}

.circle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-main);
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.2s;
}

.circle-btn:active {
    transform: scale(0.92);
}

.circle-btn.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 膰聬聹莽麓藰膰聽聫 */
.filter-bar {
    padding: 0 24px 20px;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    height: 44px;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    color: var(--text-sub);
    font-size: 14px;
}

/* 暮聠聟暮沤拧暮聦艧暮聼聼 */
.persons-page .content-area,
.beings-page .content-area,
.contact-page .content-area,
.moments-page .content-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px 24px 140px; /* 暮藰聻暮聤聽暮艧聲茅聝篓padding膹藕聦茅聛偶暮聟聧暮聠聟暮沤拧膷藰扭Dock膰聽聫茅聛沤膰聦膭 */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch; /* iOS暮拧艂膰钮聭膰钮職暮聤篓 */
}

.persons-page .content-area::-webkit-scrollbar,
.beings-page .content-area::-webkit-scrollbar,
.contact-page .content-area::-webkit-scrollbar {
    display: none;
}

/* ========== 暮聧聝茅聺藰暮聟慕暮聫艁 - 膰钮聭暮聤篓暮聧膭莽聣聡 ========== */
.swiper-container,
#persons-list {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: auto;
    padding: 0 30px;
    gap: 15px;
    height: 500px;
    align-items: center;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    will-change: scroll-position;
    transform: translateZ(0);
}

.swiper-container:active,
#persons-list:active {
    cursor: grabbing;
}

.swiper-container::-webkit-scrollbar,
#persons-list::-webkit-scrollbar {
    display: none;
}

.swipe-card {
    min-width: 85%;
    width: 85%;
    max-width: 300px;
    height: 420px;
    will-change: transform;
    transform: translateZ(0);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid #fff;
    border-radius: 32px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s, opacity 0.3s;
    cursor: pointer;
    flex-shrink: 0;
}

.swipe-card:hover {
    transform: translateY(-5px);
}

/* 椤电爜鎸囩ず鍣ㄦ牱寮?*/
.pagination-dots {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.pagination-dot:hover {
    transform: scale(1.4) !important;
    opacity: 0.8;
}

/* 馃寵 澶滈棿妯″紡 - Personas鍗＄墖娑叉€佺幓鐠?*/
body.dark-mode .swipe-card {
    background: rgba(30, 30, 35, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* 馃寵 澶滈棿妯″紡 - 椤电爜鎸囩ず鍣?*/
body.dark-mode .pagination-dot {
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
}

/* 馃寵 澶滈棿妯″紡 - 澶村儚鑳屾櫙 */
body.dark-mode .sc-avatar {
    background: rgba(50, 50, 70, 0.6) !important;
    color: var(--dark-text-secondary, #ccc) !important;
}

/* 馃寵 澶滈棿妯″紡 - 鍗＄墖鏂囧瓧 */
body.dark-mode .sc-name,
body.dark-mode .sc-badge {
    color: var(--dark-text-primary, #f0f0f0) !important;
}

.sc-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f3f4f6;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #9ca3af;
    overflow: hidden;
}

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

.sc-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
}

.sc-badge {
    margin-top: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--text-main);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
}

/* ========== 盲藕聴莽聰聼暮聟慕暮聫艁 - 暮聢聴膷膭篓膰聽藝暮藕聫 ========== */
.list-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--glass-shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

/* 馃寵 澶滈棿妯″紡 - 鍒楄〃椤规恫鎬佺幓鐠?*/
body.dark-mode .list-item {
    background: rgba(30, 30, 35, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.list-item:active {
    transform: scale(0.98);
}

.li-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6b7280;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.li-title {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.li-sub {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
}

/* ========== 膰聵聼茅聛聡暮聟慕暮聫艁 - 莽藵聭膰聽藕膰聽藝暮藕聫 ========== */
.grid-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--glass-shadow);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

/* 馃寵 澶滈棿妯″紡 - 缃戞牸鍗＄墖娑叉€佺幓鐠?*/
body.dark-mode .grid-card {
    background: rgba(30, 30, 35, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.grid-card:active {
    transform: scale(0.98);
}

.gc-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e5e7eb;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6b7280;
    font-weight: 700;
    overflow: hidden;
}

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

.gc-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.gc-role {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
}

/* ========== 莽藕聳膷啪聭茅膭木茅聺藰茅聙職莽聰篓膰聽藝暮藕聫 ========== */
/* 茅聙職莽聰篓暮聟篓暮膮聫莽藕聳膷啪聭茅膭木茅聺藰莽膮钮 - 暮藕艧暮聢艣膷艢聠莽聸聳膰聣聙膰聹聣暮聠聟暮沤拧 */
.full-screen-edit-page {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #f5f5f7 !important; /* 盲赂聧茅聙聫膰聵聨膷聝聦膰聶呕膹藕聦茅聵藳膰颅藰莽聹聥暮聢掳暮聬聨茅聺藰莽職聞暮聸啪膰聽聡 */
    z-index: 100 !important; /* 茅扭聵暮膮聜莽艧搂膹藕聦膷艢聠莽聸聳暮聹篓膰膭聦茅聺藰盲赂聤 */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.personas-edit-page,
.beings-edit-page,
.contact-edit-page {
    background: var(--bg-color) !important;
    backdrop-filter: none !important;
    font-family: 'Quicksand', sans-serif;
}

/* 盲赂艧盲赂聧暮聬聦茅膭木茅聺藰膷沤啪莽藵沤盲赂钮茅藰聵膷聣藳 */
.personas-edit-page { --app-theme: var(--persona-theme); }
.beings-edit-page { --app-theme: var(--being-theme); }
.contact-edit-page { --app-theme: var(--char-theme); }

/* 莽藕聳膷啪聭茅膭木暮陇麓茅聝篓 */
.app-header {
    flex-shrink: 0; /* 茅聵藳膰颅藰膷藰扭暮聨聥莽藕艩 */
    padding: 12px 20px; /* 暮聡聫暮掳聭padding */
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    position: relative; /* 膰聰拧盲赂艧relative */
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    min-height: 48px; /* 膷沤啪莽藵沤膰聹聙暮掳聫茅扭聵暮艧艢 */
}

/* 莽藕聳膷啪聭茅膭木膷偶聰暮聸聻膰聦聣茅聮沤膰聽藝暮藕聫 */
.edit-back-btn {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.edit-back-btn:hover {
    transform: scale(1.1);
}

.edit-back-btn:active {
    transform: scale(0.95);
}

.app-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--app-theme);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 暮沤拧暮聶篓 */
.container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 莽藕聳膷啪聭茅膭木茅聺藰盲赂颅莽職聞暮沤拧暮聶篓茅聹聙膷艢聛茅藰聺暮陇聳莽職聞暮艧聲茅聝篓莽艩艧茅聴麓 */
.edit-content-wrapper .container {
    padding-bottom: 20px !important; /* 莽搂钮茅聶陇膷偶聡暮陇職莽職聞暮艧聲茅聝篓莽艩艧茅聴麓 */
}

.card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--app-theme);
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1px;
    border-bottom: 1px dashed #dfe6e9;
    padding-bottom: 8px;
}

/* 膷啪聯暮聟慕膰聨搂盲钮艣 */
.input-row {
    margin-bottom: 15px;
}

.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d3436;
}

.input-box {
    width: 100%;
    border: 2px solid #f1f2f6;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
    font-family: inherit;
}

.input-box:focus {
    background: #fff;
    border-color: var(--app-theme);
}

textarea.input-box {
    resize: none;
    height: 80px;
}

/* 暮陇麓暮聝聫盲赂聤盲藕聽暮聦艧 */
.avatar-area {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.avatar-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    cursor: pointer;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 35px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.camera-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 34px;
    height: 34px;
    background: var(--app-theme);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
}

/* 膰聲掳暮颅聴盲艧艧膰聽藕暮聧膭 */
.digital-card {
    border: 2px solid var(--app-theme);
    position: relative;
    overflow: hidden;
    background: #fff;
}

.digital-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--app-theme);
    opacity: 0.03;
    pointer-events: none;
}

.d-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.d-avatar-box {
    width: 60px;
    height: 60px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.d-avatar {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    border: 2px dashed #b2bec3;
}

.d-edit {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--app-theme);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid #fff;
}

/* 暮陇職茅聙聣膰膭聠莽钮聞 (盲藕聴莽聰聼盲赂聯莽聰篓) */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    border: 2px solid transparent;
}

.check-item:active {
    transform: scale(0.98);
}

.check-item input[type="checkbox"] {
    accent-color: var(--app-theme);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 盲偶聺暮颅聵膰聦聣茅聮沤 */
/* ============= 莽藕聳膷啪聭茅膭木茅聺藰暮赂聝暮膮聙 ============= */
.personas-edit-page,
.beings-edit-page,
.contact-edit-page {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important; /* 盲藵偶莽聰篓膷搂聠暮聫艁茅扭聵暮艧艢 */
    max-height: 100vh !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Tab 暮聢聡膰聧藰膰聽聫膹藕聢盲藕聴莽聰聼盲赂聯莽聰篓膹藕聣 */
.tab-bar {
    flex-shrink: 0 !important;
    z-index: 9;
}

/* 莽藕聳膷啪聭茅膭木茅聺藰暮聠聟暮沤拧暮聦艧暮聼聼 - 暮聫呕膰钮職暮聤篓 */
.edit-content-wrapper {
    flex: 1 !important; /* 暮聧聽膰聧沤暮聣艩盲藵聶莽艩艧茅聴麓 */
    min-height: 0 !important; /* 暮聟艂茅聰沤膹藕職暮聟聛膷沤赂flex膰聰艣莽藕艩 */
    height: 0 !important; /* 暮聟艂茅聰沤膹藕職暮藕艧暮聢艣茅扭聵暮艧艢茅聶聬暮聢艣膰聣聧膷聝藵膰钮職暮聤篓 */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* 莽藕聳膷啪聭茅膭木茅聺藰暮聠聟暮沤拧暮沤拧暮聶篓 */
.edit-content-wrapper .container {
    padding: 20px;
    padding-bottom: 20px !important;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 盲偶聺暮颅聵膰聦聣茅聮沤膰聽聫 - 暮聸艧暮沤職暮艧聲茅聝篓 */
.save-bar {
    flex-shrink: 0 !important; /* 盲赂聧暮聟聛膷沤赂膰聰艣莽藕艩 */
    width: 100%;
    background: #fff;
    padding: 15px 20px !important;
    padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 15px)) !important; /* iPhone暮沤聣暮聟篓暮聦艧暮聼聼 */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
    box-sizing: border-box !important;
    z-index: 100 !important;
    display: flex !important;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    position: relative !important; /* 盲藵偶莽聰篓flex暮赂聝暮膮聙暮聸艧暮沤職 */
    bottom: 0;
    left: 0;
    right: 0;
}

.btn-main {
    width: 100%;
    padding: 12px; /* 暮聡聫暮掳聭padding */
    border: none;
    border-radius: 12px;
    background: var(--app-theme);
    color: #fff;
    font-size: 15px; /* 暮聡聫暮掳聭暮颅聴盲藵聯暮陇搂暮掳聫 */
    font-weight: 700;
    max-width: 600px;
    margin: 0 auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1.4;
}

.btn-main:active {
    transform: scale(0.98);
}

/* 莽艩艧莽聤艣膰聙聛 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-sub);
}

.empty-state i {
    font-size: 64px;
    opacity: 0.3;
    display: block;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 16px;
    margin: 10px 0;
}

.empty-state .hint {
    font-size: 14px;
    opacity: 0.7;
}

/* ============= 茅聙職莽聰篓膰聦聣茅聮沤膰聽藝暮藕聫 ============= */
.btn-opt {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-opt:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-opt:active {
    transform: translateY(0);
}

.btn-main {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: white;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============= Modal 膰聽藝暮藕聫暮藰聻暮藕艧 ============= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.check-item input[type="checkbox"] {
    cursor: pointer;
}

.check-item:hover {
    background: #e9ecef !important;
}

/* ============= Checkbox 莽钮聞膰聽藝暮藕聫 ============= */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
}

.checkbox-group .check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-group .check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group .check-item:hover {
    background: #e9ecef;
}

.checkbox-group .hint {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* ============= Tab 暮聢聡膰聧藰膰聽聫膰聽藝暮藕聫 ============= */
.tab-bar {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.tab-btn.active {
    color: var(--being-theme, #667eea);
}

.tab-btn:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* ============= 暮聤篓膰聙聛暮聧膭莽聣聡膰聽藝暮藕聫 ============= */
.moment-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.moment-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-del {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-del:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* ========== Echo 墓贸脫艃膶艢艃暖臉藵 ========== */
.moments-area {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f7;
    display: flex;
    flex-direction: column;
    padding-bottom: 50px; /* 脦艦 Tab 艛赂脕么艂枚偶艕藕盲 */
}

#echo-moments-list {
    flex: 1;
    overflow-y: auto;
}

.echo-tab-bar {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.echo-tab-item.active {
    color: #6c5ce7 !important;
    font-weight: 600;
}

/* 墓贸脫艃膶艢偶篓膯殴艃暖臉藵 */
.moment-card {
    background: #fff;
    padding: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.moment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.moment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.moment-author-info {
    flex: 1;
}

.moment-author-name {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.moment-time {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.moment-delete-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.moment-content {
    margin-bottom: 12px;
}

.moment-text {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 12px;
}

.moment-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.moment-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

.moment-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.moment-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.moment-likes-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.moment-actions {
    display: flex;
    gap: 12px;
}

.moment-action-btn {
    flex: 1;
    padding: 8px 16px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: 0.3s;
}

.moment-action-btn:hover {
    background: #e9ecef;
}

.moment-action-btn.active {
    color: #6c5ce7;
    background: #f5f3ff;
}

.moment-comments {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.moment-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.moment-comment:last-child {
    margin-bottom: 0;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: #6b7280;
    margin-top: 2px;
}

.comment-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ==================== Echo App: AI-Social-App UI ==================== */

/* 1. 鍏ㄥ眬鍙橀噺 (Echo) */
#echo {
    --echo-bg-color: #f0f2f5;
    --echo-accent: #6c5ce7;
    --echo-pink: #fd79a8;
    --echo-danger: #ff7675;
    --echo-text-main: #2d3436;
    --echo-text-sub: #b2bec3;
    --echo-card-bg: #ffffff;
    --echo-nav-glass: rgba(255, 255, 255, 0.9);
}

/* 2. 椤堕儴 Header */
#echo .app-header {
    padding: 50px 20px 10px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

/* 閿佸睆鏃朵笉鏄剧ず Echo Header */
.lock-screen ~ #echo .app-header,
#lock-screen:not([style*="display: none"]) ~ .screen-content #echo .app-header {
    display: none !important;
}

#echo .page-title { font-size: 24px; font-weight: 800; color: var(--echo-text-main); }
#echo .header-btn { 
    width: 40px; height: 40px; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); color: var(--echo-text-main);
    font-size: 20px; cursor: pointer;
}

/* 3. 椤甸潰瀹瑰櫒涓庡垏鎹?*/
#echo .content-scroll-area {
    flex: 1; overflow-y: scroll;
    padding-top: 100px;
    padding-bottom: 120px;
    display: none;
    scroll-behavior: smooth;
}
#echo .content-scroll-area.active { display: block; animation: echoFadeIn 0.3s ease; }

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

/* 4. 鑱婂ぉ鍒楄〃鏍峰紡 */
#echo .chat-list { padding: 0 15px; display: flex; flex-direction: column; gap: 12px; }

#echo .chat-item {
    background: var(--echo-card-bg); padding: 15px; border-radius: 20px;
    display: flex; align-items: center; gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    position: relative; transition: transform 0.1s; cursor: pointer;
}
#echo .chat-item:active { transform: scale(0.98); background: #fcfcfc; }

/* 澶村儚鍖哄煙 */
#echo .avatar-box { width: 50px; height: 50px; position: relative; flex-shrink: 0; }
#echo .single-avatar { width: 100%; height: 100%; border-radius: 18px; object-fit: cover; }

/* 缇よ亰鍫嗗彔澶村儚 */
#echo .group-stack { position: relative; width: 100%; height: 100%; }
#echo .stack-img {
    width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff;
    position: absolute; object-fit: cover;
}
#echo .s-1 { bottom: 0; left: 0; z-index: 2; }
#echo .s-2 { top: 0; right: 0; z-index: 1; opacity: 0.8; }

/* 鏂囧瓧鍐呭 */
#echo .chat-info { flex: 1; overflow: hidden; }
#echo .chat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
#echo .chat-name { font-weight: 700; font-size: 16px; color: var(--echo-text-main); }
#echo .chat-time { font-size: 11px; color: var(--echo-text-sub); font-weight: 600; }
#echo .chat-msg { 
    font-size: 13px; color: #636e72; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
#echo .sender-highlight { color: var(--echo-accent); font-weight: 600; margin-right: 4px; }

/* 鏈绾㈢偣 */
#echo .badge {
    background: var(--echo-pink); color: white; font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center;
    box-shadow: 0 2px 5px rgba(253, 121, 168, 0.3);
}

/* 5. 鏈嬪弸鍦堟牱寮?*/
#echo .moments-cover {
    height: 220px; 
    background-image: url('https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=800');
    background-size: cover; background-position: center;
    margin-top: -100px;
    position: relative; border-radius: 0 0 30px 30px; margin-bottom: 50px;
}
#echo .user-profile {
    position: absolute; bottom: -30px; right: 25px;
    display: flex; flex-direction: column; align-items: flex-end;
}
#echo .user-avatar-lg {
    width: 80px; height: 80px; border-radius: 20px; border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); object-fit: cover;
}
#echo .user-name-lg { color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 5px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); margin-right: 10px;}

/* 鍔ㄦ€佸崱鐗?*/
#echo .feed-card {
    background: #fff; margin: 0 20px 25px; padding: 20px;
    border-radius: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
#echo .feed-header { display: flex; gap: 12px; margin-bottom: 12px; }
#echo .feed-avatar { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; }
#echo .feed-meta h4 { margin: 0; font-size: 15px; color: var(--echo-text-main); }
#echo .feed-meta span { font-size: 11px; color: var(--echo-text-sub); }

#echo .feed-text { font-size: 14px; line-height: 1.6; color: #2d3436; margin-bottom: 12px; }

#echo .feed-imgs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border-radius: 12px; overflow: hidden; }
#echo .feed-imgs img { width: 100%; height: 140px; object-fit: cover; }

/* 搴曢儴鎸夐挳鏍?*/
#echo .feed-actions { 
    display: flex; justify-content: flex-end; gap: 20px; 
    margin-top: 15px; padding-top: 12px; border-top: 1px solid #f5f6fa; 
}
#echo .action-btn { 
    display: flex; align-items: center; gap: 6px; 
    color: #636e72; font-size: 13px; font-weight: 600; cursor: pointer; 
}
#echo .action-btn i { font-size: 18px; }
#echo .action-btn.active { color: var(--echo-pink); }

/* 璇勮鍖?*/
#echo .comment-section {
    margin-top: 15px; background: #f8f9fa; border-radius: 16px; padding: 15px;
    display: none;
    animation: echoSlideDown 0.2s ease-out;
}
#echo .comment-section.show { display: block; }

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

#echo .comment-item { font-size: 13px; margin-bottom: 8px; line-height: 1.4; }
#echo .c-name { color: var(--echo-accent); font-weight: 700; margin-right: 4px; }
#echo .c-text { color: #636e72; }

#echo .input-row { display: flex; gap: 10px; margin-top: 12px; }
#echo .c-input { 
    flex: 1; border: none; background: #fff; border-radius: 20px; 
    padding: 8px 12px; font-size: 13px; outline: none;
}
#echo .c-send { background: var(--echo-accent); color: #fff; border:none; border-radius: 20px; padding: 0 15px; font-size: 12px; font-weight: 700; cursor: pointer;}

/* 6. 搴曢儴鎮诞宀涘鑸?*/
#echo .nav-island {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    width: 85%; height: 70px;
    background: var(--echo-nav-glass); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 35px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 10px; z-index: 200;
}

/* 馃寵 澶滈棿妯″紡 - Echo瀵艰埅宀涙恫鎬佺幓鐠?*/
body.dark-mode #echo .nav-island {
    background: rgba(30, 30, 35, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

#echo .nav-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #b2bec3; height: 100%; position: relative; transition: 0.3s; cursor: pointer;
}
#echo .nav-tab i { font-size: 24px; margin-bottom: 2px; transition: 0.2s; }
#echo .nav-tab span { font-size: 10px; font-weight: 700; opacity: 0; transform: translateY(5px); transition: 0.2s; }

/* 閫変腑鐘舵€?*/
#echo .nav-tab.active { color: var(--echo-accent); }
#echo .nav-tab.active i { transform: translateY(-2px); }
#echo .nav-tab.active span { opacity: 1; transform: translateY(0); }

/* 瀵艰埅鏈鐐?*/
#echo .nav-dot {
    position: absolute; top: 18px; right: 32%;
    width: 8px; height: 8px; background: var(--echo-pink); border-radius: 50%;
    border: 2px solid #fff; display: none;
}
#echo .nav-dot.show { display: block; }

/* 涓棿鐨勫ぇ鍔犲彿 (FAB) */
#echo .fab-center {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-radius: 50%; border: none; color: #fff; font-size: 28px;
    display: flex; align-items: center; justify-content: center;
    transform: translateY(-22px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
#echo .fab-center:active { transform: translateY(-20px) scale(0.9); }
#echo .fab-center.rotate { transform: translateY(-22px) rotate(45deg); background: #2d3436; }

/* 7. 寮瑰嚭鍔熻兘鑿滃崟 */
#echo .menu-popover {
    position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%) scale(0.8);
    width: 200px; background: rgba(255,255,255,0.95); backdrop-filter: blur(15px);
    border-radius: 20px; padding: 8px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    opacity: 0; pointer-events: none; transition: 0.2s; z-index: 190;
    display: flex; flex-direction: column; gap: 5px;
}
#echo .menu-popover.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); }

/* 灏忎笁瑙?*/
#echo .menu-popover::after {
    content: ''; position: absolute; bottom: -8px; left: 50%; margin-left: -8px;
    border-width: 8px 8px 0; border-style: solid;
    border-color: rgba(255,255,255,0.95) transparent transparent transparent;
}

#echo .menu-option {
    padding: 12px 15px; display: flex; align-items: center; gap: 12px;
    border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--echo-text-main);
    cursor: pointer;
}
#echo .menu-option:active { background: #f1f2f6; }
#echo .menu-icon-box {
    width: 32px; height: 32px; background: #f0f2f5; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--echo-accent);
}
#echo .menu-option.danger { color: var(--echo-danger); }
#echo .menu-option.danger .menu-icon-box { background: #ffeaa7; color: var(--echo-danger); }

/* ========== Echo 搴旂敤鏍峰紡锛堢簿绠€鐗堬級========== */

/* 寮哄埗鍗犳弧锛屾棤澶氫綑 padding */
.echo-container, .chat-screen {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* 鍐呭鍖鸿嚜閫傚簲 */
.echo-content, .chat-body {
    flex: 1 !important;
    height: auto !important;
    overflow-y: auto !important;
    padding-bottom: 0 !important;
    min-height: 0 !important; /* 鍏抽敭锛氬厑璁?Flex 瀛愬厓绱犵缉灏?*/
}

/* 搴曢儴鏍忛槻閬尅 */
.echo-tabs, .chat-footer {
    flex-shrink: 0 !important;
    background: #fff !important;
    position: relative !important; /* 涓嶈 absolute */
    z-index: 100 !important;
}

/* 娑堟伅鍜屾湅鍙嬪湀瑙嗗浘 */
#view-chats, #view-moments {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

#view-moments {
    background: #f5f7fa;
}

/* 纭繚鎸夐挳鍙偣鍑?*/
.echo-tabs .tab-btn {
    cursor: pointer !important;
    transition: color 0.2s ease !important;
}

.echo-tabs .tab-btn:hover {
    opacity: 0.8;
}

/* ==================== Echo 姘存淮鐜荤拑 UI ==================== */

/* CSS 鍙橀噺 */
#app-echo {
    /* 🎨 高级灰蓝渐变背景 (钛金月光) */
    --bg-color: linear-gradient(180deg, #ffffff 0%, #dfe9f3 100%);
    --nav-text: #546e7a;
    --me-text: #0d47a1;
    --glass-bg: rgba(255, 255, 255, 0.6);  /* 提升透明度 */
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 5px 5px 15px rgba(166, 171, 189, 0.2);
    --header-h: 60px;
    --dock-h: 70px;
}

/* 鑱婂ぉ瀹瑰櫒 */
#app-echo {
    position: relative; /* 🔑 为钱包弹窗提供定位上下文 */
    background: var(--bg-color) !important;
    background-attachment: fixed !important; /* 滚动时保持固定 */
    background-size: cover;
    display: none; /* 默认隐藏，由 .page.active 控制显示 */
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* 🔑 防止弹窗溢出手机屏幕 */
}

#app-echo.active {
    display: flex; /* 激活时显示 */
}

/* 椤堕儴 Navbar */
.echo-navbar {
    height: var(--header-h);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(239, 243, 246, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000 !important; /* 强制提升层级，高于所有遮罩层 */
    flex-shrink: 0;
}

/* 兼容旧的 chat-header 类名 */
.chat-header {
    position: relative;
    z-index: 1000 !important;
}

.nav-side {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.nav-side:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.92);
}

.nav-side.right {
    justify-content: flex-end;
}

.nav-icon {
    font-size: 20px;
    color: var(--nav-text);
}

.nav-center {
    flex: 1 !important;
    display: flex !important;
    flex-direction: row !important;  /* 寮哄埗姘村钩鎺掑垪 */
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    padding: 0 10px !important;
    position: relative !important;
}

/* 鍐呴儴瀹瑰櫒涔熷己鍒舵按骞?*/
.nav-center > div {
    display: inline-flex !important;
    flex-direction: row !important;  /* 寮哄埗姘村钩 */
    align-items: center !important;
    gap: 4px !important;
}

/* AI 浜や簰鎸夐挳绱ц窡鍚嶅瓧 */
#top-interaction-btn {
    margin-left: 4px !important;
    flex-shrink: 0 !important;
    position: static !important;  /* 寮哄埗鐩稿瀹氫綅 */
    display: inline-flex !important;
    flex-direction: row !important;  /* 寮哄埗姘村钩 */
}

/* 鍚嶅瓧鍜岃緭鍏ョ姸鎬?*/
#chat-header-name,
.nav-title {
    display: inline-block !important;
    flex-shrink: 0 !important;
}

/* 姝ｅ湪杈撳叆鎻愮ず锛堝拰鍚嶅瓧鍦ㄥ悓涓€琛岋紝绱ц窡鍏跺悗锛?*/
.typing-status {
    position: static !important;  /* 鉁?绉婚櫎缁濆瀹氫綅 */
    display: inline-block !important;
    font-size: 17px !important;  /* 涓庡悕瀛楀悓鏍峰ぇ灏?*/
    font-weight: 600 !important;
    color: #999 !important;
    font-style: italic !important;
    white-space: nowrap !important;
    margin: 0 !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}

.nav-title {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: var(--nav-text) !important;
    letter-spacing: 0.5px !important;
    flex-shrink: 0 !important;
}

/* 鑱婂ぉ涓诲尯鍩?*/
#msg-container {
    flex: 1;
    padding: 20px 16px 80px 16px; /* 鍑忓皯搴曢儴鐣欑櫧锛岃鎵╁睍闈㈡澘鍙 */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    -webkit-overflow-scrolling: touch;
}

#msg-container::-webkit-scrollbar {
    display: none;
}

/* 姘旀场鏍峰紡 (鏍稿績) */
.msg-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.msg-row.me {
    flex-direction: row-reverse;
}

/* 头像容器（用于定位名字标签） */
.avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #fff;
    object-fit: cover;
    flex-shrink: 0;
}

/* 澶村儚鍔犺浇澶辫触鏃剁殑鍗犱綅 */
.msg-avatar[src=""],
.msg-avatar[src*="undefined"] {
    content: url('../assets/avatars/bear_(1).jpg');
}

.chat-avatar[src=""],
.chat-avatar[src*="undefined"],
.feed-avt[src=""],
.feed-avt[src*="undefined"] {
    content: url('../assets/avatars/bear_(1).jpg');
}

/* 鍚嶅瓧鏍囩 (Name Tag) - 缇よ亰涓撶敤鐜荤拑椋庢牸 */
.name-tag {
    position: absolute;
    top: -14px;
    left: 0;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 1px 2px 4px rgba(0,0,0,0.05);
    z-index: 2;
}

.msg-row.me .name-tag {
    left: auto;
    right: 0;
    background: rgba(13, 71, 161, 0.1);
    color: var(--me-text, #0d47a1);
}

.msg-row.other .name-tag {
    background: rgba(255,255,255,0.7);
    color: var(--nav-text, #546e7a);
}

/* ========== 馃幀 娌夋蹈寮忔覆鏌擄細瀹瑰櫒鏍峰紡 ========== */
/* msg-content 浣滀负瀹瑰櫒锛屼笉鍐嶆湁鑳屾櫙 */
.msg-content {
    max-width: calc(100% - 54px);
    width: fit-content;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
}

/* 淇濈暀鏃х殑 msg-bubble 鍏煎鎬э紙鐢ㄤ簬鐢ㄦ埛娑堟伅鍜屾湭瑙ｆ瀽鐨勬秷鎭級 */
.msg-bubble {
    max-width: calc(100% - 54px);
    width: fit-content;
    min-width: 60px;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* ========== 馃幀 娌夋蹈寮忔覆鏌擄細瀵圭櫧姘旀场 ========== */
.speech-bubble {
    padding: 12px 18px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    width: fit-content;
    max-width: 100%;
}

/* 瀵规柟鐨勫鐧芥皵娉?(纾ㄧ爞鐧? */
.msg-row.other .speech-bubble {
    color: var(--nav-text);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 5px 5px 15px rgba(166, 171, 189, 0.3), inset 2px 2px 5px #fff;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

/* 只包含图片的气泡：去除背景和边距 */
.speech-bubble:has(> .ai-image-wrap:only-child) {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 空气泡：完全隐藏 */
.speech-bubble:empty {
    display: none !important;
}

/* ========== 🎬 沉浸式渲染：动作描写 ========== */
.action-text {
    color: var(--aside-color, #78909c);
    font-style: italic;
    font-size: 13px;
    line-height: 1.5;
    padding: 4px 0;
    text-align: left;
    opacity: 0.85;
}

/* ========== 📖 小说模式：对话与旁白样式 ========== */
/* 旁白部分：斜体、灰色（气泡内的inline样式） */
.novel-narration {
    color: var(--aside-color, #78909c);
    font-style: italic;
    opacity: 0.9;
}

/* 对话部分：正常字体、稍微突出 */
.novel-speech {
    color: inherit;
    font-style: normal;
}

/* ========== 📖 线下小说模式：独立旁白段落 ========== */
/* 客观旁白：无气泡无头像，独立段落 */
.narration {
    text-align: justify;
    color: var(--aside-color, #78909c);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 1px;
    padding: 0 24px;
    margin: 0;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
}

/* 心理描写：斜体 + 降低透明度 */
.narration.thought {
    font-style: italic;
    opacity: 0.85;
}

/* 旁白上下小圆点装饰 */
.narration::before,
.narration::after {
    content: "·";
    display: block;
    text-align: center;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    opacity: 0.4;
}
.narration::before {
    margin-bottom: 2px;
}
.narration::after {
    margin-top: 2px;
}

/* 动作描写样式（括号内容，去掉括号后显示为斜体） */
.action-desc {
    font-style: italic;
    opacity: 0.82;
}

.narration .action-desc {
    display: block;
}

/* ========== 馃幀 褰掓。娑堟伅鏍峰紡锛堢數褰变綋锛?========= */
.msg-row.archived {
    opacity: 0.7;
    pointer-events: none; /* 绂佺敤浜や簰 */
}

.archived-bubble,
.archived-content {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    font-family: 'Noto Serif SC', 'STSong', serif !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
    padding: 8px 0 !important;
}

.archived-content .speech-bubble {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    font-family: 'Noto Serif SC', 'STSong', serif !important;
    padding: 0 !important;
}

.archived-content .action-text {
    font-family: 'Noto Serif SC', 'STSong', serif !important;
}

/* ========== 叙事旁白行（独立行，居中显示）========== */
.msg-row.action-narration {
    display: flex;
    justify-content: center;
    padding: 4px 20px;
    gap: 0;
}
.action-narration-text {
    max-width: 90%;
    text-align: center;
    font-size: 14px;
    line-height: 1.7;
    color: var(--aside-color, #78909c);
    font-style: italic;
}
.action-narration-text .action-text,
.action-narration-text .msg-action,
.action-narration-text .msg-thought {
    background: none;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    font-style: italic;
    color: inherit;
}

/* ========== 馃幀 鎬荤粨鏃佺櫧鏍峰紡锛堢數褰卞彊浜嬩綋锛?========= */
.msg-row.summary-narration {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    padding: 0 20px;
}

.narration-content {
    max-width: 85%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(250, 250, 255, 0.85) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(162, 155, 254, 0.2);
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(162, 155, 254, 0.15);
    position: relative;
}

.narration-icon {
    font-size: 28px;
    text-align: center;
    margin-bottom: 12px;
    opacity: 0.8;
}

.narration-text {
    font-family: 'Noto Serif SC', 'STSong', serif;
    font-size: 15px;
    line-height: 2;
    color: var(--aside-color, #78909c);
    text-align: center;
    font-style: italic;
    letter-spacing: 0.5px;
}

.narration-hint {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(162, 155, 254, 0.2);
    font-size: 11px;
    color: #a29bfe;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ========== 🎬 状态栏系统（简化版）========== */

/* 摘要栏 */
.status-summary-bar {
    position: fixed;
    top: var(--header-h, 60px);
    left: 0; right: 0; height: 32px;
    background: rgba(239, 243, 246, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 99;
    display: flex; align-items: center; 
    justify-content: center; gap: 8px;
    font-size: 12px; color: #546e7a; 
    font-weight: 500; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.status-summary-bar i { transition: transform 0.3s ease; }
.status-summary-bar.open i { transform: rotate(180deg); }

/* 展开面板 */
.status-dashboard {
    position: fixed;
    top: calc(var(--header-h, 60px) + 32px);
    left: 0; right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 15px 30px rgba(166, 171, 189, 0.15);
    padding: 16px 20px;
    z-index: 98;
    transform: translateY(-100%);
    opacity: 0; pointer-events: none;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.status-dashboard.show {
    transform: translateY(0);
    opacity: 1; pointer-events: auto;
}

/* 自适应网格：自动填充 */
.stat-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    gap: 10px; 
}

.stat-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px; 
    background: rgba(239, 243, 246, 0.5);
    border-radius: 10px; 
    border: 1px solid rgba(255,255,255,0.6);
}

/* 长文本（心声等）独占一行 */
.stat-item.full-width { 
    grid-column: 1 / -1; 
}

.stat-label { font-size: 11px; color: #90a4ae; }
.stat-value { font-size: 13px; color: var(--nav-text, #546e7a); font-weight: 600; }

/* 有状态栏时聊天区下移 */
.chat-view.has-status {
    margin-top: calc(var(--header-h, 60px) + 32px) !important;
}

/* 瀵规柟 (纾ㄧ爞鐧? - 淇濈暀鍏煎 */
.msg-row.other .msg-bubble {
    color: var(--nav-text);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 5px 5px 15px rgba(166, 171, 189, 0.3), inset 2px 2px 5px #fff;
    border-bottom-left-radius: 4px;
}

/* 鎴戞柟 (姘存淮钃? - 淇濈暀鍏煎 */
.msg-row.me .msg-bubble {
    color: var(--me-text);
    background: linear-gradient(135deg, rgba(227, 242, 253, 0.8), rgba(187, 222, 251, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 4px 8px 20px rgba(33, 150, 243, 0.25), inset 3px 3px 6px #fff;
    border-bottom-right-radius: 4px;
}

/* ========== 表情面板系统 ========== */
.sticker-panel {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 300px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 99;
    display: flex;
    flex-direction: column;
    animation: stickerPanelSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    /* 强制平滑滚动与滑动防冲突 */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    /* 彻底禁用整个面板的长按菜单和文字选中 */
    -webkit-touch-callout: none !important;
    user-select: none !important;
}

@keyframes stickerPanelSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.sticker-tabs {
    display: flex;
    gap: 8px;
}

.sticker-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.sticker-tab:hover {
    background: rgba(0, 0, 0, 0.04);
}

.sticker-tab.active {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    font-weight: 600;
}

.sticker-tab i {
    font-size: 16px;
}

.sticker-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #999;
}

.sticker-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

.sticker-close:active {
    transform: scale(0.9);
}

.sticker-grid {
    display: block;
    padding: 12px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.sticker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.sticker-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.15);
}

.sticker-item:active {
    transform: scale(1.05);
}

.sticker-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    pointer-events: none;
    /* 禁用所有表情图片的系统默认拖拽行为 */
    -webkit-user-drag: none !important;
    user-select: none !important;
}

/* ========== QQ/微信小黄脸表情系统 ========== */
.qq-emoji {
    width: 24px !important;
    height: 24px !important;
    vertical-align: text-bottom;
    margin: 0 2px;
    display: inline-block;
    flex: 0 0 auto;
    flex: 0 0 auto; /* 防止在 flex 布局中被挤压变形 */
    user-select: none;
    -webkit-user-drag: none; /* 彻底杜绝浏览器图片拖拽冲突 */
    pointer-events: none; /* 禁止点击事件（防止误触） */
    object-fit: contain;
}

/* 针对不同上下文的表情大小调整 */
.speech-bubble .qq-emoji {
    width: 26px !important;
    height: 26px !important;
}

.action-text .qq-emoji {
    width: 22px !important;
    height: 22px !important;
}

/* 表情面板中的小黄脸（可点击） */
.classic-emoji-item {
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto; /* 面板中的表情可以点击 */
}

.classic-emoji-item:hover {
    transform: scale(1.15); /* Hover 放大交互 */
}

/* 经典表情选择面板（防移动端滑动失效） */
.classic-emoji-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 10px;
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* 修复移动端内滚 */
}

/* ========== 自定义收藏贴纸（大图）========== */
.custom-sticker {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    vertical-align: middle;
    margin: 4px;
    object-fit: contain;
    cursor: pointer;
    -webkit-user-drag: none !important;
    user-select: none !important;
}

/* 滚动条样式 */
.sticker-grid::-webkit-scrollbar {
    width: 6px;
}

.sticker-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 3px;
}

.sticker-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.sticker-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* 搴曢儴 Dock */
.echo-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(239, 243, 246, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.5);
    padding: 5px 6px;
    padding-bottom: max(5px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 100; /* 纭繚濮嬬粓鍦ㄦ娊灞変笂鏂?*/
    flex-shrink: 0;
    min-height: 60px;
}

.btn-round {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    box-shadow: 3px 3px 10px rgba(166,171,189,0.2), inset 1px 1px 2px #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--nav-text);
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.btn-round:active {
    transform: scale(0.92);
}

/* 语音按钮 */
.btn-voice.active {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe) !important;
    box-shadow: 0 2px 12px rgba(108, 92, 231, 0.35) !important;
}
.btn-voice.active i { color: #fff !important; }

/* 按住说话 */
.hold-talk-pill {
    flex: 1;
    min-width: 0;
    height: 34px;
    border-radius: 17px;
    background: rgba(255,255,255,0.6);
    box-shadow: inset 2px 2px 5px rgba(166,171,189,0.1), 1px 1px 0 #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hold-talk-btn {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #546e7a;
    letter-spacing: 2px;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    border-radius: 17px;
    transition: background 0.15s, transform 0.1s;
}
.hold-talk-btn:active,
.hold-talk-btn.recording {
    background: rgba(108, 92, 231, 0.12);
    transform: scale(0.97);
}

/* 录音提示浮层 */
.voice-recording-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}
.voice-recording-box {
    width: 160px; height: 160px;
    border-radius: 24px;
    background: rgba(40,40,40,0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
}
.voice-recording-box i { font-size: 48px; }
.voice-recording-box .voice-timer { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.voice-recording-box .voice-hint { font-size: 12px; opacity: 0.7; }
.voice-recording-box.cancel-zone {
    background: rgba(200,50,50,0.88);
}
.voice-recording-box.cancel-zone .voice-hint { content: '松开取消'; }

/* 语音气泡 */
.voice-bubble {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 语音气泡颜色（根据发送者区分） */
.voice-bubble.me {
    background: var(--me-bg, #d0e7ff) !important;
    color: #1976d2 !important;
}
.voice-bubble.other {
    background: #fff !important;
    border: none !important;
    color: #888 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

/* 确保AI语音气泡的所有子元素都是浅灰色 */
.voice-bubble.other i,
.voice-bubble.other .voice-static,
.voice-bubble.other .voice-waves {
    color: #888 !important;
}

.voice-bubble.other .voice-dur {
    color: #888 !important;
}

/* 确保AI语音的声波动画条是浅灰色 */
.voice-bubble.other .v-bar {
    background: #888 !important;
}

.voice-bubble .voice-waves {
    font-size: 18px;
    letter-spacing: 2px;
    animation: voiceWave 1.2s ease-in-out infinite;
    display: block !important;
}
.voice-bubble .voice-dur {
    font-size: 13px;
    opacity: 0.7;
    display: block !important;
}
@keyframes voiceWave {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* 🎤 语音消息专用容器（垂直排列） */
.voice-msg-content {
    display: flex !important;
    flex-direction: column !important; /* 垂直排列：语音在上，文字在下 */
    gap: 0 !important;
    min-width: auto !important;
    width: fit-content !important;
    max-width: 260px !important; /* 限制最大宽度 */
}

/* 🎤 语音转录文本（微信风格：语音下方的文字） */
.voice-transcript {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.75);
    margin-top: 8px; /* 与语音气泡间距 */
    padding: 10px 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08); /* 极细分割线 */
    background: rgba(255, 255, 255, 0.6); /* 半透明白底 */
    border-radius: 12px;
    word-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
    width: 100%; /* 跟随父容器宽度 */
}

/* 转录文本 - 用户消息（蓝色调） */
.msg-row.me .voice-transcript {
    background: rgba(208, 231, 255, 0.6); /* 淡蓝底 */
    color: rgba(13, 71, 161, 0.85);
    border-top-color: rgba(13, 71, 161, 0.15);
}

/* 转录文本 - AI 消息（白色调） */
.msg-row.other .voice-transcript {
    background: rgba(255, 255, 255, 0.8); /* 白底 */
    color: rgba(0, 0, 0, 0.75);
    border-top-color: rgba(0, 0, 0, 0.08);
}

/* 🗑️ 废弃旧样式（保留兼容性） */
.voice-subtext {
    display: none; /* 不再使用旧的subtext样式 */
}

.input-pill {
    flex: 1;
    min-width: 0;
    height: 34px;
    border-radius: 17px;
    background: rgba(255,255,255,0.6);
    box-shadow: inset 2px 2px 5px rgba(166,171,189,0.1), 1px 1px 0 #fff;
    display: flex;
    align-items: center;
    padding: 0 7px;
    gap: 3px;
    position: relative;
}

/* @ 鎸夐挳鏍峰紡 */
.btn-at {
    font-size: 14px;
    font-weight: bold;
    color: #90a4ae;
    padding: 2px 3px;
    cursor: pointer;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.btn-at:hover,
.btn-at:active {
    color: var(--me-text);
}

#chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--nav-text);
    padding: 0 3px;
    outline: none;
    min-width: 0; /* 纭繚杈撳叆妗嗗彲浠ユ敹缂?*/
}

#chat-input::placeholder {
    color: rgba(84, 110, 122, 0.5);
}

/* AI 榄旀硶妫掑湪杈撳叆妗嗗唴 */
.btn-ai {
    font-size: 16px;
    color: var(--me-text);
    cursor: pointer;
    padding: 1px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.btn-ai:active {
    transform: scale(0.9);
}

/* @ 寮瑰嚭闈㈡澘 */
.at-popup {
    position: absolute;
    bottom: 70px;
    left: 60px;
    right: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 95;
    max-height: 300px;
    overflow-y: auto;
    display: none; /* 默认隐藏 */
}

.at-popup.show {
    display: block; /* 激活时显示 */
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.at-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.at-item:active {
    background: rgba(227, 242, 253, 0.5);
}

.at-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.at-name {
    font-size: 14px;
    color: var(--nav-text);
    font-weight: 500;
}

/* ========================================
   馃帹 鍏ㄦ柊瀵兼紨鎶藉眽鏋舵瀯 (Clean Drawer)
   ======================================== */

/* 鎶藉眽瀹瑰櫒 - 搴曢儴寮瑰嚭锛堝湪 Dock 涓婃柟锛?*/
.clean-drawer {
    position: absolute;
    bottom: 70px; /* Dock 楂樺害绾?70px锛屾娊灞夊湪鍏朵笂鏂?*/
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% + 70px)); /* 瀹屽叏闅愯棌鍒?Dock 涓嬫柟 */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 45; /* 浣庝簬 Dock (50)锛屼絾楂樹簬鍐呭 */
    padding: 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
    display: none; /* 默认隐藏 */
    flex-direction: column;
    gap: 15px;
    max-height: 45vh;
    overflow-y: auto;
}

/* 寮哄埗瑕嗙洊浠讳綍鍐呰仈鏍峰紡 */
#clean-drawer {
    background: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    background-image: none !important;
}

#clean-drawer[style*="background"] {
    background: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
}

/* 婵€娲荤姸鎬?- 婊戝嚭 */
.clean-drawer.active {
    display: flex; /* 激活时显示 */
    transform: translateY(0);
}

/* 缃戞牸瀹瑰櫒 */
.clean-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
}

/* 缃戞牸椤?*/
.clean-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px;
    font-size: 12px;
    color: #666;
    background: rgba(240, 244, 248, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clean-item:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.9);
}

/* 澶村儚鐩掑瓙 */
.user-avatar-box,
.npc-avatar-box {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.user-avatar-box.active,
.npc-avatar-box.active {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.user-avatar-img,
.npc-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 鍥炬爣鐩掑瓙 */
.clean-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
}

/* 鏆楅粦妯″紡 */
body.dark-mode .clean-drawer,
body.dark-mode #clean-drawer {
    background: linear-gradient(180deg,
        rgba(26, 26, 46, 0.95) 0%,
        rgba(26, 26, 46, 0.92) 100%) !important;
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .clean-item {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .clean-item:active {
    background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .clean-icon-box {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .user-avatar-box.active,
body.dark-mode .npc-avatar-box.active {
    border-color: #a29bfe;
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.3);
}

/* ========== 鎷撳睍闈㈡澘鍙岄〉 Swiper ========== */
.expansion-swiper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.expansion-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 200%; /* 2 pages */
}

.expansion-page {
    min-width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 0 5px;
}

.ex-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 5px;
    font-size: 12px;
    color: #666;
    background: rgba(240, 244, 248, 0.6);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 70px;
}

.ex-item.empty {
    opacity: 0;
    pointer-events: none;
}

.ex-item:not(.empty):active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.95);
}

.ex-item i {
    font-size: 26px;
    color: #0d47a1;
}

.ex-item span {
    font-size: 11px;
    color: #546e7a;
    font-weight: 500;
}

/* 鍒嗛〉鎸囩ず鐐?*/
.expansion-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding-bottom: 5px;
}

.expansion-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(84, 110, 122, 0.3);
    transition: all 0.3s ease;
}

.expansion-dots .dot.active {
    width: 18px;
    border-radius: 3px;
    background: rgba(13, 71, 161, 0.8);
}

/* 鏆楅粦妯″紡閫傞厤 */
body.dark-mode .ex-item {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .ex-item:not(.empty):active {
    background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .ex-item i {
    color: #64b5f6;
}

body.dark-mode .ex-item span {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .expansion-dots .dot {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .expansion-dots .dot.active {
    background: rgba(100, 181, 246, 0.9);
}

/* ========== Echo 鍔熻兘寮圭獥鏍峰紡 ========== */
.echo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.echo-modal.show {
    display: flex;
}

.echo-modal .modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

/* ActionSheet 鏍峰紡 (閫氳瘽閫夋嫨) */
.action-sheet {
    position: relative;
    z-index: 201;
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px 16px 0 0;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

.action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-bottom: 10px;
    background: rgba(240, 244, 248, 0.8);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-item:active {
    transform: scale(0.98);
    background: rgba(227, 242, 253, 0.9);
}

.action-item i {
    font-size: 24px;
    color: #0d47a1;
}

.action-item span {
    font-size: 16px;
    color: #546e7a;
    font-weight: 500;
}

.action-cancel {
    margin-top: 5px;
    padding: 14px;
    text-align: center;
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-cancel:active {
    transform: scale(0.98);
    background: rgba(255, 82, 82, 0.2);
}

/* 浠ｄ粯闈㈡澘鏍峰紡 */
.pay-panel {
    position: relative;
    z-index: 201;
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
}

.pay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pay-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.pay-close {
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
}

.pay-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pay-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.pay-tab.active {
    color: #0d47a1;
}

.pay-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #0d47a1;
    border-radius: 2px 2px 0 0;
}

.pay-content {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.pay-tab-content {
    display: none;
}

.pay-tab-content.active {
    display: block;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.cart-empty i {
    font-size: 64px;
    margin-bottom: 10px;
    opacity: 0.3;
}

.cart-empty p {
    font-size: 14px;
}

.custom-pay-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pay-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pay-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.pay-input-group input {
    padding: 12px 16px;
    background: rgba(240, 244, 248, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.2s ease;
}

.pay-input-group input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(13, 71, 161, 0.3);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.05);
}

.pay-confirm-btn {
    margin-top: 10px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(227, 242, 253, 0.9), rgba(187, 222, 251, 0.7));
    color: #0d47a1;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
    transition: all 0.2s ease;
}

.pay-confirm-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

/* 鏆楅粦妯″紡閫傞厤 */
body.dark-mode .action-sheet,
body.dark-mode .pay-panel {
    background: rgba(26, 26, 46, 0.95);
}

body.dark-mode .action-item {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .action-item:active {
    background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .action-item i {
    color: #64b5f6;
}

body.dark-mode .action-item span {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .pay-title {
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .pay-close {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .pay-tab {
    color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .pay-tab.active {
    color: #64b5f6;
}

body.dark-mode .pay-tab.active::after {
    background: #64b5f6;
}

body.dark-mode .pay-input-group label {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .pay-input-group input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .pay-input-group input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(100, 181, 246, 0.3);
}

body.dark-mode .pay-confirm-btn {
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.3), rgba(33, 150, 243, 0.2));
    color: #64b5f6;
}

/* 闈㈡澘鐗瑰畾鏍峰紡 */
.bg-pink { background: linear-gradient(135deg, #ff9a9e, #fad0c4) !important; color: #fff !important; }
.bg-yellow { background: linear-gradient(135deg, #ffeaa7, #fdcb6e) !important; color: #fff !important; }
.bg-blue { background: linear-gradient(135deg, #74b9ff, #0984e3) !important; color: #fff !important; }
.bg-red { background: linear-gradient(135deg, #ff7675, #d63031) !important; color: #fff !important; }
.bg-purple { background: linear-gradient(135deg, #a29bfe, #6c5ce7) !important; color: #fff !important; }
.bg-mint { background: linear-gradient(135deg, #81ecec, #00b894) !important; color: #fff !important; }

/* 鐜荤拑鏁堟灉绫?*/
.glass-effect {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 渚ц竟鏍忔牱寮忓寮?- 鍏ㄥ睆骞抽摵 */
#echo-sidebar,
.sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    width: 85%;
    max-width: 400px;
    height: 100%;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.05);
    
    /* 🌟 半透明磨砂玻璃效果 */
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    display: none; /* 默认隐藏 */
    flex-direction: column;
}

#echo-sidebar.active,
.sidebar.active {
    right: 0;
    display: flex; /* 激活时显示 */
}

/* 渚ц竟鏍忓唴閮ㄦ牱寮?*/
.sidebar-header,
.glass-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    flex-shrink: 0;
    color: #2d3436 !important;
    position: relative;
}

/* Header 瑁呴グ浜戞湹 */
.sidebar-header::before,
.glass-header::before {
    content: '鈽侊笍';
    position: absolute;
    top: 8px;
    right: 50px;
    font-size: 14px;
    opacity: 0.3;
    animation: cloudFloat 6s ease-in-out infinite;
}

@keyframes cloudFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.sidebar-header h3 {
    color: #2d3436 !important;
    margin: 0;
}

.sidebar-content,
.glass-content {
    padding: 0 20px 20px 20px;
    flex: 1;
    overflow-y: auto;
    
    /* 馃啎 娣辩伆瀛椾綋 */
    color: #2d3436 !important;
}

/* 鐜荤拑鍗＄墖 - 缇よ亰缁勪欢瀹瑰櫒 */
.glass-card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.65));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.8));
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: var(--glass-shadow, 5px 5px 15px rgba(166, 171, 189, 0.2));
}

/* 馃啎 鑳屾櫙璁剧疆闈㈡澘鏍峰紡 */
.bg-panel-wrapper {
    margin-bottom: 12px;
}

.bg-panel-content {
    animation: slideDown 0.3s ease;
}

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

/* 馃啎 渚ц竟鏍忚缃」鏍囩浼樺寲 */
.setting-label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #2d3436 !important;
}

.setting-input,
.setting-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(45, 52, 54, 0.15);
    border-radius: 8px;
    font-size: 14px;
    color: #2d3436 !important;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.setting-input:focus,
.setting-textarea:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.setting-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.setting-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
    /* 鉁?鏀逛负娓呮柊鐜荤拑鎬侀鏍?*/
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(162, 155, 254, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(162, 155, 254, 0.2);
}

.setting-btn:active {
    transform: translateY(0);
    background: rgba(240, 240, 255, 0.8);
}

/* 馃啎 灏忓瀷鎸夐挳 */
.setting-btn-sm {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2d3436;
    /* 鉁?鏀逛负娓呮柊鐜荤拑鎬侀鏍?*/
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.setting-btn-sm:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(162, 155, 254, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(162, 155, 254, 0.2);
}

.setting-btn-sm:active {
    transform: translateY(0);
    background: rgba(240, 240, 255, 0.8);
}

/* 馃啎 鍗遍櫓鎸夐挳鏍峰紡 */
.danger-btn {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 245, 245, 0.8) 100%) !important;
    border: 1px solid rgba(231, 76, 60, 0.15) !important;
    color: #e74c3c !important;
}

.danger-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 245, 245, 0.9) 0%, 
        rgba(255, 235, 235, 0.9) 100%) !important;
    border-color: rgba(231, 76, 60, 0.3) !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15) !important;
    transform: translateY(-1px);
}

.danger-btn:active {
    transform: translateY(0);
    background: rgba(255, 225, 225, 0.9) !important;
}

/* 馃啎 鍗遍櫓鍖哄煙鏍囬 */
.danger-zone .setting-title {
    color: #e74c3c !important;
}

/* 绉婚櫎鍗遍櫓鍖哄煙鐨勮竟妗嗭紙鐢?HTML 鍐呰仈鏍峰紡瀹氫箟锛?*/
.danger-zone {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
}

/* 馃啎 鍔犺浇鏃嬭浆鍔ㄧ敾 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.setting-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #2d3436 !important;
}

.switch-btn {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(200, 200, 200, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.switch-btn.on {
    /* 鉁?鏀逛负娓呮柊鐨勮杽鑽风豢鐜荤拑鎬?*/
    background: linear-gradient(135deg, 
        rgba(129, 236, 236, 0.7) 0%, 
        rgba(0, 184, 148, 0.7) 100%);
    border-color: rgba(0, 184, 148, 0.2);
}

.switch-btn.on::after {
    left: 22px;
}

.setting-divider {
    height: 1px;
    background: rgba(45, 52, 54, 0.08);
    margin: 20px 0;
}

.setting-section {
    margin-bottom: 0;
}

.setting-title {
    font-size: 15px;
    font-weight: 700;
    color: #2d3436 !important;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 缇ゅ叕鍛婃牱寮?*/
.notice-title {
    font-size: 12px;
    color: #ff9800;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notice-content {
    font-size: 13px;
    color: var(--nav-text);
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 8px;
    border-radius: 6px;
}

.notice-content:hover {
    background: rgba(255, 152, 0, 0.05);
}

.notice-content[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ff9800;
    outline: none;
}

/* 鎴愬憳澧欑綉鏍?*/
.member-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.grid-avatar {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid #fff;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.grid-avatar:active {
    transform: scale(0.95);
}

.add-member {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px dashed #b0bec5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bec5;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
}

.add-member:hover {
    border-color: var(--me-text);
    color: var(--me-text);
}

/* 渚ц竟鏍忚缃」 */
.sidebar-section-title {
    font-size: 12px;
    color: #90a4ae;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 10px 0;
    color: var(--nav-text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

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

#sidebar-mask,
.sidebar-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
    display: none;
}

#sidebar-mask.active,
.sidebar-mask.active {
    opacity: 1;
    pointer-events: auto;
    display: block;
}

/* === 聊天列表样式（美化版）=== */
.chat-list-container {
    background: #ffffff !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 1;
}

#view-chats {
    background: #ffffff !important;
    min-height: 100vh;
}

/* 语音图标在 dock 中的对齐 */
.echo-dock .btn-voice-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s, filter 0.2s;
}
.echo-dock .btn-voice-icon:active {
    opacity: 1;
    transform: scale(0.92);
}

/* 聊天列表导航栏 */
.chat-list-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-list-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main, #1a1a1a);
    margin: 0;
}

.chat-list-header .back-btn,
.chat-list-header .menu-btn {
    font-size: 24px;
    color: var(--text-main, #1a1a1a);
    padding: 4px;
    cursor: pointer;
    background: none;
    border: none;
    transition: transform 0.2s ease;
}

.chat-list-header .back-btn:active,
.chat-list-header .menu-btn:active {
    transform: scale(0.92);
}

.chat-list-header .menu-btn {
    font-size: 26px;
}

/* 故事栏（Story Rail）*/
.story-rail,
#chat-avatars-rail {
    padding: 12px 16px;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
    scrollbar-width: none;
}

.story-rail::-webkit-scrollbar,
#chat-avatars-rail::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.story-avatar-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #2979ff, #00e5ff); /* 娲昏穬鐘舵€佸厜鐜?*/
}

.story-avatar-wrap.seen {
    background: #e0e0e0;
}

.story-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

/* 群头像九宫格在story容器中的适配 */
.story-avatar-wrap .group-avatar-grid {
    width: 100%;
    height: 100%;
    border: 2px solid #fff;
}

.story-name {
    font-size: 11px;
    color: var(--text-main);
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    cursor: pointer;
}

.story-avatar-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #2979ff, #00e5ff);
}

.story-avatar-wrap.seen {
    background: #e0e0e0;
}

.story-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.story-name {
    font-size: 11px;
    color: var(--text-main, #1a1a1a);
}

/* 鑱婂ぉ鍒楄〃 */
.chat-list-items {
    flex: 1;
    background: #fff;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:active {
    background: #f5f5f5;
}

/* 澶村儚瀹瑰櫒 */
.avatar-box,
.avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.single-avatar,
.chat-avatar {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

/* 鏈绾㈢偣鏍稿績鏍峰紡 */
.unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    border: 2px solid #fff;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

.group-stack {
    width: 100%;
    height: 100%;
    position: relative;
}

.stack-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    object-fit: cover;
}

.s-1 {
    bottom: 0;
    left: 0;
    z-index: 2;
}

.s-2 {
    top: 0;
    right: 0;
    z-index: 1;
    opacity: 0.9;
}

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

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

.chat-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main, #1a1a1a);
}

.chat-time {
    font-size: 12px;
    color: #b0b0b0;
}

.chat-msg {
    font-size: 14px;
    color: var(--text-sub, #888888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-msg.unread {
    font-weight: 600;
    color: var(--text-main, #1a1a1a);
}

.sender-highlight {
    color: var(--me-text);
    font-weight: 600;
}

.chat-list-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(84, 110, 122, 0.5);
}

.chat-list-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.chat-list-empty-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.chat-list-empty-hint {
    font-size: 14px;
    opacity: 0.8;
}

/* ========== 鏈嬪弸鍦?Feed 娴佹牱寮忥紙缇庡寲鐗堬級========== */

/* 灏侀潰鍖哄煙 */
.moments-cover-area {
    position: relative;
    width: 100%;
    height: 280px;
    margin-bottom: 50px; /* 缁欐偓娴ご鍍忕暀浣嶇疆 */
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.moments-cover-area:hover {
    opacity: 0.95;
}

.cover-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 0 0 24px 24px;
    display: block;
}

/* 鐢ㄦ埛鎮诞淇℃伅 */
.user-float {
    position: absolute;
    bottom: -30px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    z-index: 10;
}

.user-float-name {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 40px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.user-float-avatar {
    width: 84px;
    height: 84px;
    border-radius: 16px;
    border: 3px solid #fff;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 鎮诞澶村儚鍜屽悕瀛?*/
.moments-user-float {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.moments-user-float-name {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.moments-user-float-avatar {
    width: 84px;
    height: 84px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Feed 瀹瑰櫒 */
.feed-container {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Feed 椤癸紙缇庡寲鏍峰紡锛?/
.feed-item {
    display: flex !important;
    gap: 12px;
    width: 100% !important;
    box-sizing: border-box !important;
}

.feed-avt {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}

.feed-main {
    flex: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 16px;
}

.feed-name {
    font-size: 15px;
    font-weight: 700;
    color: #405f80;
    margin-bottom: 6px;
}

.feed-text {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 10px;
    word-wrap: break-word;
    white-space: pre-wrap;
    display: block !important;
}

/* 濯掍綋缃戞牸 */
.media-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.media-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
}

.media-img.single {
    width: 200px;
    height: auto;
    max-height: 300px;
    border-radius: 8px;
}

/* Feed 宸ュ叿鏍?*/
.feed-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.feed-time {
    font-size: 12px;
    color: #b0b0b0;
}

.action-btn {
    background: #f2f4f7;
    padding: 4px 10px;
    border-radius: 4px;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e8eaed;
}

.action-btn.active {
    background: #ffe6f0;
    color: #fd79a8;
}

/* 璇勮鍖?*/
.comment-section {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.comment-section.show {
    display: block;
}

.comment-item {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.c-name {
    color: #405f80;
    font-weight: 600;
    margin-right: 4px;
}

.c-text {
    color: var(--text-main);
}

.input-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.c-input {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 13px;
    background: #f8f8f8;
    outline: none;
}

.c-input:focus {
    outline: none;
    border-color: #007aff;
    background: #fff;
}

.c-send {
    padding: 6px 12px;
    background: #007aff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.c-send:hover {
    background: #0051d5;
}

.c-send:active {
    transform: scale(0.95);
}

/* Feed 椤?*/
.feed-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

/* 宸︿晶澶村儚 */
.feed-avt {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 鍙充晶鍐呭鍖?*/
.feed-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 浣滆€呭悕 */
.feed-name {
    font-size: 16px;
    font-weight: 600;
    color: #405f80;
    line-height: 1.3;
}

/* 鍐呭鏂囨湰 */
.feed-text {
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    word-wrap: break-word;
}

/* 鍥剧墖缃戞牸 */
.feed-media-grid {
    display: grid;
    gap: 4px;
    margin-top: 4px;
}

.feed-media-grid.single-image {
    grid-template-columns: 1fr;
}

.feed-media-grid.multi-images {
    grid-template-columns: repeat(3, 1fr);
}

.feed-media-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.feed-media-grid.single-image .feed-media-img {
    max-width: 200px;
    aspect-ratio: auto;
    max-height: 300px;
}

/* 宸ュ叿鏍?*/
.feed-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 8px;
}

.feed-time {
    font-size: 12px;
    color: #b0b0b0;
}

.feed-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.feed-action-btn:hover {
    background: #e8e8e8;
}

.feed-action-btn.active {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.feed-action-btn i {
    font-size: 15px;
}

.feed-delete-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.feed-delete-btn:hover {
    color: #ff3b30;
}

/* 璇勮鍖?*/
.feed-comments {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-comment {
    display: flex;
    gap: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.feed-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-comment-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feed-comment-author {
    color: #405f80;
    font-weight: 600;
    font-size: 14px;
}

.feed-comment-text {
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.5;
}

.feed-comment-time {
    font-size: 11px;
    color: #b0b0b0;
    margin-top: 2px;
}

/* 绌虹姸鎬?*/
.moments-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #999;
}

.moments-empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.moments-empty-state p {
    font-size: 15px;
    margin: 4px 0;
}

.moments-empty-state .hint {
    font-size: 13px;
    color: #bbb;
}

/* ========== 鏈嬪弸鍦堥〉闈㈠竷灞€璋冩暣锛堜负搴曢儴Tab鐣欑┖闂达級========== */
.moments-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.moments-page .content-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 70px !important; /* 涓哄簳閮═ab鐣欏嚭绌洪棿 */
}

.moments-page #moments-list {
    padding: 15px;
    padding-bottom: 20px;
}

/* 搴曢儴Tab鍥哄畾鏍峰紡 */
.moments-page .echo-tabs {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 55px !important;
    display: flex !important;
    border-top: 1px solid #eee !important;
    background: rgba(255, 255, 255, 0.96) !important;
    z-index: 1000 !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Tab鎸夐挳鏍峰紡 */
.moments-page .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.moments-page .tab-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.moments-page .tab-btn.active {
    color: #007aff !important;
}

.moments-page .tab-btn:not(.active) {
    color: #ccc !important;
}

/* ========== AI 浜や簰閿牱寮?========== */
#top-interaction-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: static !important;  /* 寮哄埗闈炵粷瀵瑰畾浣?*/
    z-index: auto !important;  /* 绉婚櫎鍥哄畾 z-index */
}

#top-interaction-btn img {
    transition: all 0.3s ease;
}

#top-interaction-btn:hover img {
    opacity: 1 !important;
    filter: brightness(1.1) !important;
}

#top-interaction-btn:active {
    transform: scale(0.95);
}

/* ========== 缁堟瀬瑙嗚淇锛氬睆钄界孩鐐瑰拰榛勮壊鑳屾櫙 ========== */

/* 1. 褰诲簳灞忚斀椤堕儴鎸夐挳鐨勬墍鏈変吉鍏冪礌锛堢孩鐐归€氬父鍦ㄨ繖閲岋級 */
#top-interaction-btn::before,
#top-interaction-btn::after {
    display: none !important;
    content: "" !important;
    background: transparent !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 2. 灞忚斀椤堕儴鎸夐挳鍐呴儴鐨勬墍鏈夐潪鍥炬爣鍏冪礌 */
#top-interaction-btn > *:not(img),
#top-interaction-btn .badge,
#top-interaction-btn .unread-badge,
#top-interaction-btn span:not(.interact-key),
#top-interaction-btn div {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* 3. 纭繚鎸夐挳鏈韩骞插噣鏃犺楗?*/
#top-interaction-btn {
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
}

/* [宸插垹闄ゆ墍鏈夋棫鐨?panel-drawer 淇鏍峰紡] */

/* 鏅冨姩鏁堟灉锛堢兢鑱?AI 浜や簰鏃讹級*/
.interact-key.shaking,
#top-interaction-btn.shaking {
    animation: shake 0.5s infinite;
}

/* ========== Echo 渚ц竟鏍忥細鎯呮劅浠〃鐩?========== */
.affection-dashboard {
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.15) 0%, 
        rgba(255, 105, 180, 0.1) 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.affection-meter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.affection-icon {
    font-size: 36px;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10% { transform: scale(1.1); }
    20% { transform: scale(1); }
}

.affection-info {
    flex: 1;
}

.affection-label {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 600;
}

.affection-value {
    font-size: 28px;
    font-weight: 700;
    color: #ff6b81;
    line-height: 1;
}

.affection-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.affection-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b81 0%, #ff8fab 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.affection-desc {
    text-align: center;
    font-size: 13px;
    color: #e84393;
    font-weight: 600;
}

/* 浠ｇ爜椋庢牸杈撳叆妗?*/
.code-input {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
}

/* 涓栫晫涔﹀垪琛?*/
.worldbook-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mount-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mount-checkbox-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mount-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mount-empty {
    text-align: center;
    padding: 20px;
    color: #95a5a6;
    font-size: 13px;
}

/* ========== 鑱婂ぉ姘旀场锛氬熀纭€瀹氫綅 ========== */
.msg-bubble,
.msg-content {
    position: relative;
}

/* ========== 馃挅 濂芥劅搴﹀弽棣堢郴缁?========== */
.affection-feedback {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 4px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    animation: affectionPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.affection-feedback .heart-pulse {
    position: relative;
    top: 0;
    right: 0;
    font-size: 16px;
    animation: heartBeat 1.2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 0, 0, 0.3));
}

.affection-feedback span {
    font-size: 13px;
    font-weight: 700;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
}

@keyframes affectionPop {
    0% { 
        transform: scale(0) translateY(10px);
        opacity: 0;
    }
    70% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 鏃х増鍏煎锛堜粎蹇冭烦锛?*/
.heart-pulse:not(.affection-feedback .heart-pulse) {
    position: absolute;
    top: -12px;
    right: -12px;
    font-size: 20px;
    animation: heartPulse 1s infinite, heartFloat 2s ease-in-out infinite;
    z-index: 10;
    filter: drop-shadow(0 2px 8px rgba(255, 107, 129, 0.5));
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes heartFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 澶滈棿妯″紡涓嬬殑绾㈠績 */
body.dark-mode .heart-pulse:not(.affection-feedback .heart-pulse) {
    filter: drop-shadow(0 2px 12px rgba(255, 107, 129, 0.8));
}

/* ========== Toggle Switch (鎭嬬埍鑴戞姂鍒剁瓑寮€鍏? ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.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: #ccc;
    transition: .3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 澶滈棿妯″紡 */
body.dark-mode .toggle-slider {
    background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ========================================== */
/* ========== 鏄熸眹 (Starhub) 绀惧尯鏍峰紡 ========== */
/* ========================================== */

#starhub {
    /* 鍩虹瑙嗚璁惧畾 (淇濇寔绮夎壊娴佸厜) */
    background: linear-gradient(45deg, #ff9a9e, #fad0c4, #fad0c4, #a18cd1, #fbc2eb);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG { 
    0% { background-position: 0% 50%; } 
    50% { background-position: 100% 50%; } 
    100% { background-position: 0% 50%; } 
}

#starhub .blob { 
    position: absolute; 
    border-radius: 50%; 
    filter: blur(50px); 
    opacity: 0.8; 
    z-index: 0; 
    pointer-events: none; 
}

#starhub .blob-1 { 
    width: 250px; 
    height: 250px; 
    background: #a18cd1; 
    top: -80px; 
    left: -80px; 
    animation: float 10s infinite alternate; 
}

#starhub .blob-2 { 
    width: 280px; 
    height: 280px; 
    background: #ff9a9e; 
    bottom: -80px; 
    right: -80px; 
    animation: float 10s infinite alternate-reverse; 
}

@keyframes float { 
    0% { transform: translate(0, 0); } 
    100% { transform: translate(30px, 50px); } 
}

/* 鍩虹鐜荤拑鍗＄墖 */
#starhub .glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #fff;
}

/* 鎸夐挳鏍峰紡 */
#starhub .btn-login-refined {
    width: 100%; 
    padding: 14px; 
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.85);
    color: #7a4ba3;
    font-weight: bold; 
    border: none; 
    font-size: 16px; 
    cursor: pointer; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.1); 
    transition: transform 0.1s;
}

#starhub .btn-login-refined:active { 
    transform: scale(0.98); 
    background: rgba(255,255,255,0.95); 
}

#starhub .glass-btn { 
    cursor: pointer; 
    transition: 0.2s; 
    padding: 10px 20px; 
    border-radius: 20px; 
    background: #fff; 
    color: #a18cd1; 
    border: none; 
    font-size: 14px; 
    font-weight: bold; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

#starhub .glass-btn:active { 
    opacity: 0.9; 
    transform: scale(0.96); 
}
        
#starhub .btn-icon { 
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 22px; 
    cursor: pointer; 
    border-radius: 12px; 
    transition: 0.2s; 
    color: white; 
}

#starhub .btn-icon:active { 
    background: rgba(255,255,255,0.3); 
    transform: scale(0.95); 
}

/* 杈撳叆妗?*/
#starhub .input-glass {
    width: 100%; 
    padding: 12px; 
    margin-bottom: 12px; 
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.5); 
    border-radius: 12px; 
    color: #fff; 
    font-size: 14px;
}

#starhub .input-glass::placeholder { 
    color: rgba(255,255,255,0.7); 
}

/* 閽堝娴呰壊寮圭獥鍐呯殑杈撳叆妗嗕紭鍖?*/
#starhub .light-popup-content .input-glass {
    background: rgba(0,0,0,0.05); 
    border: 1px solid rgba(0,0,0,0.1); 
    color: #333;
}

#starhub .light-popup-content .input-glass::placeholder { 
    color: #999; 
}

/* 涓嬫媺鑿滃崟 */
#starhub .custom-select { 
    position: relative; 
    width: 100%; 
    margin-bottom: 15px; 
}

#starhub .select-trigger {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 12px 15px; 
    border-radius: 12px; 
    cursor: pointer; 
    font-size: 14px; 
    color: white;
    background: rgba(255,255,255,0.2); 
    border: 1px solid rgba(255,255,255,0.4);
}

#starhub .select-options {
    position: absolute; 
    top: 110%; 
    left: 0; 
    width: 100%; 
    border-radius: 14px;
    overflow: hidden; 
    z-index: 900; 
    display: none; 
    flex-direction: column;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(25px); 
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: fadeIn 0.2s ease;
}

#starhub .select-option { 
    padding: 14px 15px; 
    font-size: 14px; 
    cursor: pointer; 
    color: #444; 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    font-weight: 500;
}

#starhub .select-option:last-child { 
    border-bottom: none; 
}

#starhub .select-option:active { 
    background: rgba(0,0,0,0.05); 
}

#starhub .select-option i { 
    margin-right: 8px; 
    color: #a18cd1; 
}

/* Chips */
#starhub .chip-group { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    margin-bottom: 15px; 
}

#starhub .chip {
    padding: 10px 20px; 
    border-radius: 20px; 
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.5); 
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#starhub .chip:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#starhub .chip.active { 
    background: #fff; 
    color: #a18cd1; 
    border-color: #fff; 
    font-weight: bold; 
    box-shadow: 0 4px 16px rgba(161,140,209,0.4);
}

/* 鏍囩瀹瑰櫒妯悜婊氬姩 - 涓濇粦浣撻獙 */
#starhub-chips-container {
    /* 纭繚鍙互妯悜婊氬姩 */
    overflow-x: auto !important;
    overflow-y: hidden !important;
    /* 闅愯棌婊氬姩鏉?*/
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    /* 骞虫粦婊氬姩 */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* 鍏佽妯悜瑙︽懜婊戝姩 */
    touch-action: pan-x !important;
    /* 纭繚鍐呭涓嶄細琚埅鏂?*/
    padding-right: 40px !important;
    /* 浼樺寲瑙︽懜婊氬姩鎬ц兘 */
    will-change: scroll-position;
    /* 榧犳爣婊氳疆妯悜婊氬姩鏀寔 */
    overscroll-behavior-x: contain;
}

#starhub-chips-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 纭繚鏈€鍚庣殑鍗犱綅绗︾敓鏁?*/
#starhub-chips-container span:last-child {
    flex-shrink: 0 !important;
    min-width: 40px !important;
}

/* 鐧诲綍椤佃鑹插垪琛ㄦ粴鍔ㄦ潯闅愯棌 */
#persona-list-starhub {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

#persona-list-starhub::-webkit-scrollbar {
    display: none !important;
}

#starhub .light-popup-content .chip { 
    border-color: rgba(0,0,0,0.1); 
    color: #666; 
}

#starhub .light-popup-content .chip.active { 
    background: #a18cd1; 
    color: white; 
}

/* 甯冨眬涓庢ā鎬佹 */
#starhub .view-container {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    display: none; 
    flex-direction: column; 
}

#starhub .nav-header {
    height: 90px; 
    padding: 40px 20px 10px; 
    flex-shrink: 0;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 100;
}

#starhub .scroll-content { 
    flex: 1; 
    overflow-y: auto; 
    padding: 10px 20px 100px; 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

#starhub .scroll-content::-webkit-scrollbar { 
    display: none; 
}

/* 模态弹窗遮罩 */
#starhub .modal-mask {
    position: absolute !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100% !important; 
    height: 100% !important; 
    z-index: 2000 !important;
    background: rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(5px) !important;
    display: none !important; 
    align-items: center !important; 
    justify-content: center !important;
    flex-direction: row !important; /* 覆盖通用的 column */
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.3s;
}

#starhub .modal-mask.active { 
    display: flex !important;
    opacity: 1 !important; 
    pointer-events: auto !important;
}

/* 寮圭獥涓讳綋 */
#starhub .modal-body { 
    width: 85%; 
    padding: 25px; 
    border-radius: 24px; 
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    color: #333;
    animation: popUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

@keyframes popUp { 
    from { transform: scale(0.9); } 
    to { transform: scale(1); } 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ========== 鍏宠仈瑙掕壊鍒楄〃鏍峰紡 ========== */
.related-characters-list {
    max-height: 200px;
    overflow-y: auto;
}

.related-char-item {
    transition: background 0.2s ease;
}

.related-char-item:hover {
    background: rgba(0, 184, 148, 0.08) !important;
}

.related-char-checkbox:checked + img {
    border: 2px solid #00b894 !important;
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.2);
}

/* 澶滈棿妯″紡 */
body.dark-mode .related-characters-list {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .related-char-item {
    color: var(--dark-text-primary) !important;
}

body.dark-mode .related-char-item:hover {
    background: rgba(0, 184, 148, 0.15) !important;
}

/* ========== 瀵兼紨闈㈡澘鏆楅粦妯″紡 ========== */
/* [宸插垹闄ゆ棫鐨?grid 鏆楅粦鏍峰紡锛屼娇鐢ㄦ柊鐨?clean-drawer 鏆楅粦鏍峰紡] */

/* ========================================== */
/* ========== 蹇冭 Whisper - 鎸傚潬鐩扷I ========== */
/* ========================================== */

#app-whisper { 
    background: radial-gradient(circle at 50% 30%, #2b1d2e 0%, #150f16 100%);
    height: 100vh; 
    width: 100%;
    overflow-x: visible; 
    overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
    font-family: 'Cinzel', serif;
    transition: background 1s ease;
    position: relative;
}

/* === 顶部导航栏 === */
.whisper-root .whisper-header {
    padding: 50px 20px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
    z-index: 200 !important;
}

.whisper-root .whisper-back-btn {
    font-size: 24px !important;
    color: #d81b60 !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 201 !important;
}

.whisper-root .whisper-overview-btn {
    font-size: 12px !important;
    color: #c2185b !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, rgba(255,182,193,0.3), rgba(233,30,99,0.2)) !important;
    border-radius: 20px !important;
    padding: 6px 12px !important;
    position: relative !important;
    z-index: 201 !important;
    white-space: nowrap !important;
    border: 1px solid rgba(233,30,99,0.3) !important;
    font-weight: 500 !important;
    letter-spacing: 1px !important;
    box-shadow: 0 2px 8px rgba(233,30,99,0.15) !important;
    transition: all 0.3s ease !important;
}

.whisper-root .whisper-overview-btn:hover {
    background: linear-gradient(135deg, rgba(255,182,193,0.5), rgba(233,30,99,0.3)) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(233,30,99,0.25) !important;
}

.whisper-root .whisper-overview-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(233,30,99,0.2) !important;
}

.whisper-root .whisper-title {
    flex: 1;
    text-align: center;
    font-family: 'Dancing Script', 'Cinzel', cursive;
    font-size: 26px;
    color: #c2185b;
    font-weight: 600;
    letter-spacing: 2px;
}

/* === 椤堕儴锛氫汉鐗╁垏鎹?=== */
#app-whisper .char-tray, .whisper-root .char-tray {
    width: 100%; padding: 20px 0 10px; z-index: 20;
    display: flex; flex-direction: column; align-items: center;
    background: linear-gradient(to bottom, rgba(255,182,193,0.3), transparent);
}
#app-whisper .tray-scroll, .whisper-root .tray-scroll { 
    display: flex; gap: 25px; padding-bottom: 10px; 
}
#app-whisper .gem-avatar, .whisper-root .gem-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    position: relative; cursor: pointer;
    border: 2px solid rgba(233,30,99,0.3);
    transition: 0.4s; opacity: 0.6; transform: scale(0.9);
}
#app-whisper .gem-avatar img, .whisper-root .gem-avatar img { 
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; 
}
#app-whisper .gem-avatar.active, .whisper-root .gem-avatar.active { 
    opacity: 1; transform: scale(1.15); 
    border-color: #e91e63; 
    box-shadow: 0 0 15px rgba(233,30,99,0.5); 
}

/* === 3D 鑸炲彴 === */
#app-whisper .locket-stage {
    flex: 1; width: 100%; perspective: 1000px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

/* === 鎸傚潬鐩掓湰浣?(Wrapper) === */
#app-whisper .locket-wrapper {
    width: 260px; height: 340px; position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
#app-whisper .locket-wrapper.switching { animation: locketSwitch 0.6s ease forwards; }

@keyframes locketSwitch {
    0% { transform: scale(1) rotateY(0); opacity: 1; }
    50% { transform: scale(0.8) rotateY(180deg); opacity: 0; }
    100% { transform: scale(1) rotateY(0); opacity: 1; }
}

/* --- 1. 鐩掔洊 (Front Cover) --- */
#app-whisper .locket-cover {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 120px 120px 30px 30px;
    transform-origin: left center;
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5; /* 鐩栧瓙鍦ㄦ渶涓婇潰 */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.3);
    backface-visibility: visible; /* 鍏佽鐪嬪埌鑳岄潰 */
    
    /* 榛樿鏉愯川锛歋ayoo (鐜懓閲? */
    background: linear-gradient(135deg, #f3dcdf 0%, #d4a5a5 50%, #8f6266 100%);
    box-shadow: inset 0 0 30px rgba(255,255,255,0.5), 5px 20px 40px rgba(0,0,0,0.6);
}

/* 鐩栧瓙涓婄殑瀹濈煶 */
#app-whisper .gemstone {
    width: 70px; height: 90px; border-radius: 50%;
    margin-bottom: 20px; position: relative;
    background: radial-gradient(circle at 30% 30%, #ffebef 0%, #d43f5e 60%, #591122 100%);
    box-shadow: 0 0 20px rgba(212, 63, 94, 0.5);
    border: 3px solid rgba(255,255,255,0.5);
}
#app-whisper .gemstone::after {
    content: ''; position: absolute; top: 15px; left: 15px; width: 20px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.9); transform: rotate(45deg); filter: blur(4px);
}

/* --- 2. 鐩掕韩/鍐呰儐 (Back/Inside) --- */
#app-whisper .locket-body {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 120px 120px 30px 30px;
    z-index: 1;
    /* 涓濈粧鍐呰‖鑳屾櫙 */
    background: radial-gradient(circle, #4a2c35 0%, #2b161c 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8); /* 鍐呴儴娣遍們闃村奖 */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 30px;
}

/* 鍐呴儴淇＄焊 (Folded Paper) */
#app-whisper .secret-paper {
    width: 100%; height: 85%;
    background: #fffbf0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    padding: 25px 20px;
    display: flex; flex-direction: column;
    transform: scale(0.95);
    transition: all 0.5s ease 0.2s; /* 寤惰繜灞曞紑 */
    opacity: 0; /* 榛樿闅愯棌锛屾墦寮€鏃舵樉鐜?*/
    position: relative;
    overflow: hidden;
}

/* 绾稿紶绾圭悊 */
#app-whisper .secret-paper::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
}

#app-whisper .paper-content {
    font-family: 'Dancing Script', cursive; font-size: 18px; color: #444; line-height: 1.6;
    text-align: center; margin-top: 10px;
}
#app-whisper .paper-sign {
    margin-top: auto; text-align: right; font-size: 12px; color: #888; font-family: 'Cinzel';
}

/* 鍐呴儴鍙戝厜鐗规晥 (Glow) */
#app-whisper .inner-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100px; height: 100px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    filter: blur(30px); opacity: 0; transition: 1s; pointer-events: none;
}

/* --- 3. 閿侀摼灞?(Chains) --- */
#app-whisper .jewelry-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none; transition: opacity 0.5s;
}
#app-whisper .fine-chain {
    position: absolute; width: 4px; height: 180px;
    background-image: radial-gradient(circle, transparent 30%, #ffd700 35%, #ffd700 45%, transparent 50%);
    background-size: 8px 8px; background-repeat: repeat-y;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
    transform-origin: top center; transition: all 0.8s ease-in;
}
#app-whisper .chain-l { top: 0; left: 20px; transform: rotate(-22deg); }
#app-whisper .chain-r { top: 0; right: 20px; transform: rotate(22deg); }

#app-whisper .mini-lock {
    position: absolute; top: 160px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 44px; z-index: 11; transition: all 0.6s ease-in;
}
#app-whisper .lock-shackle {
    position: absolute; top: 0; left: 6px; right: 6px; height: 20px;
    border: 3px solid #ffd700; border-bottom: none; border-radius: 15px 15px 0 0; z-index: -1;
}
#app-whisper .lock-body {
    position: absolute; top: 14px; width: 100%; height: 30px;
    background: radial-gradient(circle at 30% 30%, #fff, #ffd700);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
}
#app-whisper .lock-keyhole { width: 4px; height: 8px; background: #333; border-radius: 2px; }

/* --- 鍔ㄧ敾鐘舵€佺被 --- */

/* 鎷掔粷璁块棶 (鎶栧姩) */
@keyframes lockShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px) rotate(-3deg); }
    40%, 80% { transform: translateX(4px) rotate(3deg); }
}
#app-whisper .jewelry-layer.shake-it { animation: lockShake 0.4s ease-in-out; }

/* 瑙ｉ攣鎺夎惤 */
#app-whisper .locket-wrapper.unlocking .chain-l { transform: rotate(-35deg) translateY(400px); opacity: 0; }
#app-whisper .locket-wrapper.unlocking .chain-r { transform: rotate(35deg) translateY(400px); opacity: 0; }
#app-whisper .locket-wrapper.unlocking .mini-lock { top: 500px; opacity: 0; transform: translateX(-50%) rotate(180deg); }

/* 鎵撳紑鐘舵€?(Open) */
#app-whisper .locket-wrapper.is-open .locket-cover { transform: rotateY(-120deg); } /* 鐩栧瓙缈诲紑 */
#app-whisper .locket-wrapper.is-open .secret-paper { opacity: 1; transform: scale(1); } /* 淇＄焊娴幇 */
#app-whisper .locket-wrapper.is-open .inner-glow { opacity: 0.6; } /* 鍏夋晥浜捣 */

#app-whisper .jewelry-layer.hidden { display: none; }

/* === 瑙掕壊瀹氬埗鍖?(Theme Customization) === */

/* 1. Sayoo: 鐜懓閲?+ 蹇冨舰閿?+ 绮夎壊淇＄焊 */
#app-whisper .theme-sayoo .locket-body { background: radial-gradient(circle, #4a2c35 0%, #2b161c 100%); }
#app-whisper .theme-sayoo .secret-paper { background: #fff0f5; }
#app-whisper .theme-sayoo .fine-chain { background-image: radial-gradient(circle, transparent 30%, #eecfd6 35%, #d4af37 45%, transparent 50%); }
#app-whisper .theme-sayoo .lock-shackle { border-color: #d4af37; }
#app-whisper .theme-sayoo .lock-body {
    background: radial-gradient(circle at 30% 30%, #fff, #ffb7c5);
    clip-path: path('M18,30 C5,18 0,10 2,5 A10,10 0 0,1 18,10 A10,10 0 0,1 34,5 C36,10 31,18 18,30 Z');
    height: 32px; top: 12px;
}

/* 2. Master: 鐧介櫠 + 鍐版柟閿?+ 鍐拌摑淇＄焊 */
#app-whisper.theme-master { background: radial-gradient(circle at 50% 30%, #2c3e50 0%, #000000 100%); }
#app-whisper .theme-master .locket-cover { background: linear-gradient(135deg, #ffffff 0%, #eef2f3 50%, #d1dce5 100%); }
#app-whisper .theme-master .gemstone { background: radial-gradient(circle at 30% 30%, #fff 0%, #e0f7fa 40%, #e1bee7 70%, #b2ebf2 100%); }
#app-whisper .theme-master .locket-body { background: radial-gradient(circle, #2c3e50 0%, #1a252f 100%); }
#app-whisper .theme-master .secret-paper { background: #f0f8ff; color: #333; }

#app-whisper .theme-master .fine-chain { background-image: radial-gradient(circle, transparent 30%, #fff 35%, #c0c0c0 45%, transparent 50%); }
#app-whisper .theme-master .lock-shackle { border-color: #c0c0c0; height: 22px; }
#app-whisper .theme-master .lock-body {
    background: radial-gradient(circle at 30% 30%, #fff, #87ceeb);
    border-radius: 4px; box-shadow: 0 0 10px #87ceeb;
}

/* 3. Demon: 榛戦噾 + U鍨嬮攣 + 缇婄毊鍗?*/
#app-whisper.theme-demon { background: radial-gradient(circle at 50% 30%, #1a0505 0%, #000000 100%); }
#app-whisper .theme-demon .locket-cover { background: linear-gradient(135deg, #434343 0%, #1c1c1c 50%, #000000 100%); }
#app-whisper .theme-demon .gemstone { background: radial-gradient(circle at 30% 30%, #ff8a80 0%, #b71c1c 50%, #4a0000 100%); }
#app-whisper .theme-demon .locket-body { background: radial-gradient(circle, #1a0505 0%, #000 100%); }
#app-whisper .theme-demon .secret-paper { background: #fdf5e6; border: 1px solid #d4af37; }

#app-whisper .theme-demon .fine-chain { background-image: radial-gradient(circle, transparent 30%, #333 35%, #d4af37 45%, transparent 50%); }
#app-whisper .theme-demon .lock-shackle { border-color: #5d4037; border-width: 4px; }
#app-whisper .theme-demon .lock-body {
    background: radial-gradient(circle at 30% 30%, #ff4500, #333);
    border-radius: 0 0 18px 18px; box-shadow: 0 2px 10px #000;
}

/* 搴曢儴鎸夐挳 */
#app-whisper .btn-unlock {
    position: absolute; bottom: 50px;
    padding: 12px 30px; background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.5); border-radius: 30px;
    color: #fff; letter-spacing: 2px; cursor: pointer;
    transition: 0.3s; z-index: 30;
}
#app-whisper .btn-unlock:hover { background: #fff; color: #000; box-shadow: 0 0 20px #fff; }

/* 杩斿洖鎸夐挳 */
#app-whisper .back-btn {
    position: absolute; top: 20px; left: 20px; z-index: 100;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px; cursor: pointer;
    transition: 0.3s;
}
#app-whisper .back-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* ========================================
   涓囪薄 (Genesis) 鍏ㄥ眬鍙橀噺鍜屽熀纭€鏍峰紡
   ======================================== */

/* 涓囪薄瀹瑰櫒鑳屾櫙 */
#genesis,
#genesis-content {
    background: #fdfbfb;
    background-image: linear-gradient(180deg, #fff1eb 0%, #ace0f9 100%);
    background-attachment: fixed;
}

/* 涓囪薄涓撶敤CSS鍙橀噺 */
#genesis-content {
    /* 鑳屾櫙锛氭殩鑹叉祦浣?*/
    --bg-base: #fdfbfb;
    --bg-gradient: linear-gradient(180deg, #fff1eb 0%, #ace0f9 100%);
    
    /* 瀵艰埅鏍?& 澶撮儴 */
    --header-bg: rgba(255, 255, 255, 0.75);
    
    /* 鍗＄墖 */
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: #fff;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    
    /* 鏂囧瓧棰滆壊 */
    --text-title: #2d3436; 
    --text-body: #4b4b4b;
    --text-sub: #95a5a6;
    --text-placeholder: #b2bec3;
    
    /* 寮鸿皟鑹?*/
    --accent: #ff7675;
    --link: #0984e3;
    
    /* 灏哄 */
    --radius-card: 18px;
}

/* 澶滈棿妯″紡鑳屾櫙 */
body.dark-mode #genesis,
body.dark-mode #genesis-content {
    background: #1a1a2e;
    background-image: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
}

/* 澶滈棿妯″紡鍙橀噺 */
body.dark-mode #genesis-content {
    --bg-base: #1a1a2e;
    --bg-gradient: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
    --card-bg: rgba(40, 40, 60, 0.95);
    --card-border: rgba(255,255,255,0.1);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --text-title: #ecf0f1;
    --text-body: #bdc3c7;
    --text-sub: #7f8c8d;
    --text-placeholder: #5f6368;
}

/* 椤堕儴Tab鍒囨崲 */
.top-tabs {
    display: flex;
    padding: 10px 16px;
    gap: 8px; /* 缩小间距让Tab更紧凑 */
    flex-shrink: 0;
}

.top-tab-item {
    flex: 1; /* 让两个Tab平均分配宽度 */
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-sub);
    background: rgba(255,255,255,0.4);
    transition: 0.3s;
    cursor: pointer;
    border: none;
    text-align: center; /* 文字居中 */
}

.top-tab-item.active {
    background: #fff;
    color: var(--text-title);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

body.dark-mode .top-tab-item {
    background: rgba(255,255,255,0.1);
}

body.dark-mode .top-tab-item.active {
    background: rgba(255,255,255,0.2);
    color: #ecf0f1;
}

/* 涓昏鍥惧鍣?*/
.main-view {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0 16px 40px 16px;
    display: none;
}

.main-view.active {
    display: block;
}

/* 瑕嗙洊灞傞〉闈紙浠庡彸渚ф粦鍏ョ殑缂栬緫椤碉級 */
.overlay-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base, #fdfbfb);
    background-image: var(--bg-gradient, linear-gradient(180deg, #fff1eb 0%, #ace0f9 100%));
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

/* 万象页面覆盖层 - 使用 absolute 定位覆盖整个 genesis 页面 */
.genesis-overlay.overlay-page {
    position: absolute;
    z-index: 200;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 确保 mobile-modal 在最顶层显示 */
#mobile-modal.modal-mask {
    z-index: 9999 !important;
}

/* ================= 万象页面美化组件 ================= */

/* 胶囊按钮 */
.genesis-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.genesis-pill-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    transform: translateY(-1px);
}

.genesis-pill-btn:active {
    transform: scale(0.96);
}

.genesis-pill-btn i {
    font-size: 13px;
}

/* 自定义下拉选择框 */
.genesis-select-wrap {
    position: relative;
    width: 100%;
}

.genesis-select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-title, #2d3436);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    border: 1.5px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.genesis-select::-ms-expand {
    display: none;
}

.genesis-select:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
}

.genesis-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(102, 126, 234, 0.12);
}


.genesis-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #667eea;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.genesis-select:focus + .genesis-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* 暗色模式适配 */
body.dark-mode .genesis-pill-btn {
    color: #a78bfa;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(167, 139, 250, 0.3);
}

body.dark-mode .genesis-select {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.9) 0%, rgba(25, 25, 40, 0.9) 100%);
    border-color: rgba(167, 139, 250, 0.25);
    color: #f1f1f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .genesis-select:hover {
    border-color: rgba(167, 139, 250, 0.4);
}

body.dark-mode .genesis-select:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .genesis-select option {
    background: #1a1a2e;
    color: #f1f1f1;
}

body.dark-mode .genesis-select-arrow {
    color: #a78bfa;
}

/* 底部操作按钮区域 */
.genesis-bottom-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    margin-bottom: 80px;
}

.genesis-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.genesis-action-btn i {
    font-size: 16px;
}

/* 主要按钮 - 渐变蓝 */
.genesis-action-primary {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.genesis-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}

.genesis-action-primary:active {
    transform: scale(0.97);
}

/* 危险按钮 - 红色调 */
.genesis-action-danger {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1.5px solid rgba(255, 107, 107, 0.3);
}

.genesis-action-danger:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.5);
}

.genesis-action-danger:active {
    transform: scale(0.97);
}

/* 暗色模式适配 */
body.dark-mode .genesis-action-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

body.dark-mode .genesis-action-danger {
    color: #ff8787;
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 135, 135, 0.3);
}

/* ================= 万象选择器（模型等） ================= */
.genesis-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    border: 1.5px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-title, #2d3436);
}

.genesis-picker:hover {
    border-color: rgba(102, 126, 234, 0.4);
}

.genesis-picker i {
    color: #667eea;
    font-size: 18px;
}

/* 选择器弹窗遮罩 */
.genesis-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.genesis-picker-overlay.show {
    opacity: 1;
}

/* 选择器面板 */
.genesis-picker-panel {
    width: 100%;
    max-height: 50vh;
    background: linear-gradient(145deg, #fff 0%, #f8faff 100%);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

.genesis-picker-overlay.show .genesis-picker-panel {
    transform: translateY(0);
}

.genesis-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    flex-shrink: 0;
}

.genesis-picker-header i {
    font-size: 22px;
    color: #95a5a6;
    cursor: pointer;
    padding: 4px;
}

.genesis-picker-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.genesis-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 14px;
    color: #2d3436;
    cursor: pointer;
    transition: background 0.15s ease;
}

.genesis-picker-item:hover {
    background: rgba(102, 126, 234, 0.08);
}

.genesis-picker-item.selected {
    color: #667eea;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
}

.genesis-picker-item i {
    color: #667eea;
    font-size: 16px;
}

/* 暗色模式 */
body.dark-mode .genesis-picker {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.9) 0%, rgba(25, 25, 40, 0.9) 100%);
    border-color: rgba(167, 139, 250, 0.25);
    color: #f1f1f1;
}

body.dark-mode .genesis-picker i {
    color: #a78bfa;
}

body.dark-mode .genesis-picker-panel {
    background: linear-gradient(145deg, #1a1a2e 0%, #16162a 100%);
}

body.dark-mode .genesis-picker-header {
    color: #f1f1f1;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .genesis-picker-item {
    color: #e0e0e0;
}

body.dark-mode .genesis-picker-item:hover {
    background: rgba(167, 139, 250, 0.15);
}

body.dark-mode .genesis-picker-item.selected {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.2);
}

/* ================= 万象确认弹窗 ================= */
.genesis-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.genesis-confirm-overlay.show {
    opacity: 1;
}

.genesis-confirm-panel {
    width: 280px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 255, 0.98) 100%);
    border-radius: 20px;
    padding: 28px 24px 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.genesis-confirm-overlay.show .genesis-confirm-panel {
    transform: scale(1) translateY(0);
}

.genesis-confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(214, 48, 49, 0.3);
}

.genesis-confirm-icon i {
    font-size: 28px;
    color: #fff;
}

.genesis-confirm-title {
    font-size: 17px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 8px;
}

.genesis-confirm-message {
    font-size: 14px;
    color: #636e72;
    line-height: 1.5;
    margin-bottom: 24px;
}

.genesis-confirm-buttons {
    display: flex;
    gap: 12px;
}

.genesis-confirm-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.genesis-confirm-cancel {
    background: rgba(99, 110, 114, 0.1);
    color: #636e72;
}

.genesis-confirm-cancel:hover {
    background: rgba(99, 110, 114, 0.15);
}

.genesis-confirm-cancel:active {
    transform: scale(0.96);
}

.genesis-confirm-ok {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(214, 48, 49, 0.3);
}

.genesis-confirm-ok:hover {
    box-shadow: 0 6px 16px rgba(214, 48, 49, 0.4);
    transform: translateY(-1px);
}

.genesis-confirm-ok:active {
    transform: scale(0.96);
}

/* 暗色模式适配 */
body.dark-mode .genesis-confirm-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .genesis-confirm-panel {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.98) 0%, rgba(25, 25, 40, 0.98) 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

body.dark-mode .genesis-confirm-title {
    color: #f1f1f1;
}

body.dark-mode .genesis-confirm-message {
    color: #a0a0a0;
}

body.dark-mode .genesis-confirm-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #b0b0b0;
}

body.dark-mode .genesis-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ================= 万象页面美化组件 END ================= */

.overlay-page.open {
    transform: translateX(0);
}

/* 瑕嗙洊椤靛鑸爮 */
.overlay-page .nav-bar,
.overlay-nav-bar {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--header-bg, rgba(255, 255, 255, 0.75));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.overlay-nav-title {
    font-weight: 700;
    font-size: 17px;
    color: var(--text-title);
}

.overlay-nav-btn {
    font-size: 15px;
    color: var(--accent, #ff7675);
    font-weight: 500;
    cursor: pointer;
    padding: 5px 10px;
    background: none;
    border: none;
}

.overlay-nav-btn.cancel {
    color: var(--text-sub);
}

/* nav-bar鍐呯殑鍏冪礌鏍峰紡 */
.overlay-page .nav-title,
.nav-bar .nav-title {
    font-weight: 700;
    font-size: 17px;
    color: var(--text-title, #2d3436);
}

.overlay-page .nav-icon,
.nav-bar .nav-icon {
    font-size: 22px;
    color: var(--accent, #ff7675);
    padding: 5px;
    cursor: pointer;
}

.overlay-page .nav-text-btn,
.nav-bar .nav-text-btn {
    font-size: 15px;
    color: var(--accent, #ff7675);
    font-weight: 500;
    cursor: pointer;
}

/* 椤甸潰瀹瑰櫒 */
.page-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: calc(100vh - 110px);
    overflow: hidden;
}

/* 瑕嗙洊椤靛彲婊氬姩鍐呭 */
.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px 100px 16px;
    -webkit-overflow-scrolling: touch;
}

/* 澶滈棿妯″紡瑕嗙洊椤?*/
body.dark-mode .overlay-page {
    background: var(--bg-base, #1a1a2e);
    background-image: var(--bg-gradient, linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%));
}

body.dark-mode .overlay-page .nav-bar,
body.dark-mode .overlay-nav-bar {
    background: rgba(30, 30, 40, 0.95);
    border-bottom-color: rgba(255,255,255,0.1);
}

/* ================= 绉诲姩绔脊绐楋紙鐜荤拑鎷熸€侊級================= */
.modal-mask {
    position: absolute; /* 改为 absolute，相对于 phone-screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* ================= 居中模态卡片 - 代付弹窗 ================= */

/* 遮罩层 */
#modal-cart,
.modal-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex !important;
    align-items: center !important; /* ⭐ 垂直居中 */
    justify-content: center !important; /* ⭐ 水平居中 */
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#modal-cart.active,
.modal-cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#modal-cart[style*="display: none"],
.modal-cart-overlay[style*="display: none"] {
    display: none !important;
}

/* ⭐ 卡片主体 - 居中弹出 */
#modal-cart .sheet,
.modal-cart-overlay .sheet {
    background: #fff;
    width: 85% !important;
    max-width: 320px !important;
    border-radius: 20px !important; /* ⭐ 四角全圆 */
    margin: 0 !important;
    padding: 24px 20px !important;
    transform: scale(0.8) !important; /* 初始缩小 */
    opacity: 0 !important;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important; /* 弹性动画 */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* ⭐ 激活状态 - 弹性弹出 */
#modal-cart.active .sheet,
.modal-cart-overlay.active .sheet {
    transform: scale(1) !important;
    opacity: 1 !important;
    animation: popIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
}

/* ⭐ 弹出动画 */
@keyframes popIn {
    0% { 
        transform: scale(0.8); 
        opacity: 0; 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* ⭐ 隐藏底部把手 */
#modal-cart .sheet::before,
.modal-cart-overlay .sheet::before {
    display: none !important;
}

/* 头部区域 */
#modal-cart .sheet-header,
.modal-cart-overlay .sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#modal-cart .sheet-title,
.modal-cart-overlay .sheet-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

#modal-cart .sheet-close,
.modal-cart-overlay .sheet-close {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
}

#modal-cart .sheet-close:hover,
.modal-cart-overlay .sheet-close:hover {
    color: #ff758c;
}

/* 购物车列表 */
#modal-cart .cart-list,
.modal-cart-overlay .cart-list {
    margin-bottom: 20px;
}

/* 总计行 */
#modal-cart .cart-total-row,
.modal-cart-overlay .cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
    font-weight: 600;
}

#modal-cart .total-label,
.modal-cart-overlay .total-label {
    color: #888;
    font-size: 15px;
}

#modal-cart .total-amount,
.modal-cart-overlay .total-amount {
    font-size: 22px;
    color: #ff758c;
    font-weight: 700;
}

/* 确认按钮 */
#modal-cart .btn-pay-confirm,
.modal-cart-overlay .btn-pay-confirm {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    background: linear-gradient(135deg, #ff758c, #ff7eb3);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 117, 140, 0.3);
}

#modal-cart .btn-pay-confirm:hover,
.modal-cart-overlay .btn-pay-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 117, 140, 0.4);
}

#modal-cart .btn-pay-confirm:active,
.modal-cart-overlay .btn-pay-confirm:active {
    transform: translateY(0);
}

/* 夜间模式适配 */
body.dark-mode #modal-cart .sheet,
body.dark-mode .modal-cart-overlay .sheet {
    background: #1c1c1e;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode #modal-cart .sheet-title,
body.dark-mode .modal-cart-overlay .sheet-title {
    color: #fff;
}

body.dark-mode #modal-cart .cart-total-row,
body.dark-mode .modal-cart-overlay .cart-total-row {
    border-top-color: #38383a;
}

body.dark-mode #modal-cart .total-label,
body.dark-mode .modal-cart-overlay .total-label {
    color: #98989d;
}

/* 原有的 modal-cart overlay 规则（向后兼容） */
#modal-cart.overlay {
    display: flex !important;
    align-items: center !important; /* ⭐ 居中对齐 */
    justify-content: center !important; /* ⭐ 居中对齐 */
}

#modal-cart.overlay[style*="display: none"] {
    display: none !important;
}

#modal-cart.overlay[style*="display: flex"] {
    display: flex !important;
}

.modal-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-panel {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    box-shadow: var(--glass-shadow);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    color: var(--glass-text);
    width: 100%;
    box-sizing: border-box;
}

/* 深色模式下的弹窗面板 - 与万象App风格一致 */
body.dark-mode .modal-panel {
    background: rgba(30, 30, 35, 0.95) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-bottom: none !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.modal-mask.show .modal-panel {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
    font-size: 15px;
    color: var(--glass-text);
    background: transparent !important; /* 覆盖紫色背景 */
}

.modal-btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.modal-btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.modal-btn-secondary {
    flex: 1;
    padding: 16px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--glass-text);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.modal-btn-secondary:active {
    transform: translateY(0) scale(0.98);
    background: rgba(0, 0, 0, 0.1);
}

body.dark-mode .modal-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

body.dark-mode .modal-btn-secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

/* 寮圭獥鍐呰緭鍏ユ */
#mobile-modal input[type="text"],
#mobile-modal input[type="password"],
#mobile-modal textarea {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    color: var(--glass-text);
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

#mobile-modal input:focus,
#mobile-modal textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.dark-mode #mobile-modal input[type="text"],
body.dark-mode #mobile-modal input[type="password"],
body.dark-mode #mobile-modal textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

body.dark-mode #mobile-modal input:focus,
body.dark-mode #mobile-modal textarea:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 选项列表交互 */
.option-item {
    transition: all 0.2s ease;
}

.option-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateX(4px);
}

.option-item:active {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(2px) scale(0.98);
}

body.dark-mode .option-item {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85) !important;
}

body.dark-mode .option-item span {
    color: rgba(255, 255, 255, 0.85) !important;
}

body.dark-mode .option-item i {
    color: rgba(255, 255, 255, 0.4) !important;
}

body.dark-mode .option-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

body.dark-mode .option-item:active {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px) scale(0.98);
}

body.dark-mode .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background: transparent !important; /* 覆盖紫色背景 */
}

body.dark-mode .modal-header div {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* 为mobile-modal中的modal-header特别指定样式 */
#mobile-modal .modal-header {
    background: transparent !important;
}

body.dark-mode #mobile-modal .modal-header {
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* 鏂囦欢澶瑰唴閮═ab */
.folder-tabs {
    display: flex;
    background: rgba(0,0,0,0.05);
    padding: 4px;
    border-radius: 12px;
    margin: 10px 16px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    color: var(--text-sub);
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    background: none;
    border: none;
}

.tab-btn.active {
    background: #fff;
    color: var(--text-title);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 鏂囦欢澶瑰ご閮紙鎼滅储/娣诲姞鍖哄煙锛?*/
.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 4px 8px 4px;
}

.header-title {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.action-icon {
    font-size: 18px;
    color: var(--text-sub);
    transition: 0.2s;
    cursor: pointer;
}

.action-icon.active {
    color: var(--accent);
}

/* 鎼滅储妗嗭紙鍙姌鍙狅級 */
.search-box-wrap {
    height: 0;
    overflow: hidden;
    opacity: 0;
    margin-bottom: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box-wrap.show {
    height: 44px;
    opacity: 1;
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    height: 36px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-title);
}

.search-input:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 118, 117, 0.2);
    outline: none;
}

/* 澶滈棿妯″紡 */
body.dark-mode .folder-tabs {
    background: rgba(255,255,255,0.05);
}

body.dark-mode .tab-btn.active {
    background: rgba(255,255,255,0.1);
    color: #ecf0f1;
}

body.dark-mode .search-input {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.05);
    color: #ecf0f1;
}

/* ========================================
   涓囪薄棰勮绯荤粺鏍峰紡
   ======================================== */

/* 鍖哄煙鏍囩 */
.section-label {
    font-size: 13px;
    color: var(--text-sub, #95a5a6);
    font-weight: 600;
    margin: 20px 4px 8px 4px;
    letter-spacing: 0.3px;
}

/* 鍗＄墖缁勫鍣?*/
.card-group {
    background: rgba(255,255,255,0.95);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* 鍒楄〃椤瑰浘鏍?*/
.item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    margin-right: 12px;
}

/* 鍒楄〃椤瑰唴瀹?*/
.item-content {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-desc {
    font-size: 12px;
    color: #95a5a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 鍙崇澶?*/
.arrow-right {
    font-size: 20px;
    color: #bdc3c7;
    margin-left: 8px;
    transition: transform 0.2s;
}

.list-item:hover .arrow-right {
    transform: translateX(3px);
}

/* iOS椋庢牸寮€鍏?*/
.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.ios-switch input {
    display: none;
}

.ios-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e4e4e4;
    transition: 0.3s;
    border-radius: 24px;
}

.ios-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ios-switch input:checked + .slider {
    background-color: #ff7675;
}

.ios-switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* 鍒犻櫎鎸夐挳 */
.delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.05);
    color: #95a5a6;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 8px;
}

.delete-btn:hover {
    background: #ff7675;
    color: white;
}

/* 鏂囦欢澶筎ab鎸夐挳 */
.folder-tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    color: #95a5a6;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.folder-tab-btn.active {
    background: #fff;
    color: #2d3436;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 澶滈棿妯″紡閫傞厤 */
body.dark-mode .section-label {
    color: #bdc3c7;
}

body.dark-mode .card-group {
    background: rgba(40, 40, 60, 0.7);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

body.dark-mode .item-title {
    color: #ecf0f1;
}

body.dark-mode .item-desc {
    color: #95a5a6;
}

body.dark-mode .arrow-right {
    color: #7f8c8d;
}

body.dark-mode .delete-btn {
    background: rgba(255,255,255,0.1);
    color: #bdc3c7;
}

body.dark-mode .delete-btn:hover {
    background: #e74c3c;
    color: white;
}

/* ========================================
   涓囪薄API閰嶇疆琛ㄥ崟鏍峰紡
   ======================================== */

/* 杈撳叆琛?*/
.input-row {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

/* 琛ㄥ崟鏍囩 */
.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-title, #2d3436);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 骞插噣杈撳叆妗?*/
.clean-input, .clean-select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-body, #4b4b4b);
    padding: 4px 0;
    font-family: inherit;
    outline: none;
}

.clean-input::placeholder {
    color: var(--text-placeholder, #b2bec3);
}

.clean-select {
    cursor: pointer;
}

/* 灏忓瀷琛ㄥ崟鎸夐挳 */
.form-btn-small {
    font-size: 12px;
    color: var(--link, #0984e3);
    background: rgba(9, 132, 227, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}

.form-btn-small:hover {
    background: rgba(9, 132, 227, 0.2);
}

/* 婊戝潡 */
.range-slider {
    width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin-top: 10px;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
}

/* 澶滈棿妯″紡閫傞厤 */
body.dark-mode .input-row {
    border-bottom-color: rgba(255,255,255,0.1);
}

body.dark-mode .form-label {
    color: #ecf0f1;
}

body.dark-mode .clean-input,
body.dark-mode .clean-select {
    color: #ecf0f1;
}

body.dark-mode .clean-input::placeholder {
    color: #7f8c8d;
}

body.dark-mode .range-slider {
    background: #34495e;
}

body.dark-mode .range-slider::-webkit-slider-thumb {
    background: #ecf0f1;
}

/* =============================================== */
/* 鐞崇悈 (Treasure) - 鏆栬壊璐墿绯荤粺 */
/* =============================================== */

/* 鏆栬壊绯诲彉閲?*/
#treasure {
    --treasure-bg-body: #f9f6f2;
    --treasure-bg-white: #ffffff;
    --treasure-text-dark: #5c4b43;
    --treasure-text-light: #a69b95;
    --treasure-theme-orange: #ff9f43;
    --treasure-theme-gradient: linear-gradient(135deg, #ffc048 0%, #ff9f43 100%);
    --treasure-theme-btn-shadow: 0 6px 15px rgba(255, 159, 67, 0.3);
    --treasure-radius-card: 12px;
    --treasure-shadow-card: 0 4px 12px rgba(92, 75, 67, 0.05);
    --treasure-nav-height: 60px;
    --treasure-safe-bottom: env(safe-area-inset-bottom);
}

#treasure {
    background: var(--treasure-bg-body);
    color: var(--treasure-text-dark);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.treasure-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--treasure-bg-body);
    z-index: 50;
    gap: 12px;
}

.treasure-back {
    font-size: 24px;
    color: var(--treasure-text-dark);
    cursor: pointer;
}

.treasure-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--treasure-text-dark);
    letter-spacing: 0.5px;
}

.treasure-search-box {
    flex: 1;
    height: 38px;
    background: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    box-shadow: var(--treasure-shadow-card);
    position: relative;
}

.treasure-search-icon {
    font-size: 18px;
    color: var(--treasure-text-light);
    margin-right: 8px;
    cursor: pointer;
    transition: color 0.3s;
}

.treasure-search-icon:hover {
    color: var(--treasure-theme-orange);
}

.treasure-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--treasure-text-dark);
}

.treasure-search-input::placeholder {
    color: var(--treasure-text-light);
}

/* 鍔犺浇鏇村鎸夐挳鍖哄煙 */
.treasure-load-more-box {
    display: flex;
    justify-content: center;
    padding: 24px 16px;
}

/* ====== 馃帹 娆㈣繋鐣岄潰 v3锛堝畬鍏ㄥ弬鐓ц璁★級 ====== */

.treasure-welcome-v3 {
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

/* 椤堕儴鑻遍泟鍖猴紙绫宠壊鑳屾櫙锛?*/
.treasure-hero-section {
    padding: 20px 24px 40px;
}

.treasure-hero-title {
    font-size: 36px;
    font-weight: 800;
    color: #5c4b43;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.treasure-hero-desc {
    font-size: 14px;
    color: #a69b95;
    line-height: 1.6;
}

/* 涓诲唴瀹圭櫧鑹插崱鐗?*/
.treasure-main-card {
    flex: 1;
    background: #ffffff;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    padding: 36px 24px;
    box-shadow: 0 -10px 30px rgba(92, 75, 67, 0.03);
}

/* 鍒嗙被鏍囬 */
.treasure-section-title {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
}

.treasure-section-title i {
    color: #ff9f43;
    font-size: 20px;
    margin-right: 8px;
}

.treasure-section-title span {
    font-size: 16px;
    font-weight: 700;
    color: #5c4b43;
}

/* 鍒嗙被缃戞牸 */
.treasure-cats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.treasure-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.treasure-cat-box {
    width: 72px;
    height: 72px;
    background: #f9f6f2;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff9f43;
    font-size: 32px;
    box-shadow: inset 0 0 12px rgba(92, 75, 67, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.treasure-cat:active .treasure-cat-box {
    transform: scale(0.92);
}

.treasure-cat-name {
    font-size: 14px;
    font-weight: 600;
    color: #5c4b43;
}

/* 搴曢儴鎻愮ず */
.treasure-bottom-hint {
    margin-top: 48px;
    text-align: center;
    font-size: 13px;
    color: #a69b95;
    background: #f9f6f2;
    padding: 14px 16px;
    border-radius: 14px;
    line-height: 1.6;
}

/* ====== 鏃х増鏍峰紡锛堢Щ闄ゆ垨娉ㄩ噴锛?====== */

/* 娆㈣繋鐣岄潰瀹瑰櫒 */
.treasure-welcome-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

/* 椤堕儴鏍囬鍖?*/
.treasure-welcome-header {
    padding: 20px 24px 30px;
}

.treasure-welcome-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--treasure-text-dark);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.treasure-welcome-subtitle {
    font-size: 13px;
    color: var(--treasure-text-light);
    line-height: 1.6;
}

/* 鍐呭鍖哄煙锛堢櫧鑹茶儗鏅級 */
.treasure-welcome-content {
    flex: 1;
    background: #ffffff;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    padding: 30px 24px;
    box-shadow: 0 -10px 30px rgba(92, 75, 67, 0.03);
}

/* 鍒嗙被鏍囬 */
.treasure-category-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.treasure-category-header i {
    color: var(--treasure-theme-orange);
    font-size: 18px;
    margin-right: 6px;
}

.treasure-category-header span {
    font-size: 15px;
    font-weight: 700;
    color: var(--treasure-text-dark);
}

/* 鍒嗙被缃戞牸锛堟柊鐗堬級 */
.treasure-category-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.treasure-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.treasure-cat-item:active {
    transform: scale(0.95);
}

.treasure-cat-icon-box {
    width: 64px;
    height: 64px;
    background: var(--treasure-bg-body);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--treasure-theme-orange);
    font-size: 30px;
    box-shadow: inset 0 0 10px rgba(92, 75, 67, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.treasure-cat-item:hover .treasure-cat-icon-box {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 16px rgba(255, 159, 67, 0.15);
}

.treasure-cat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--treasure-text-dark);
}

/* 搴曢儴鎻愮ず */
.treasure-welcome-hint {
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    color: var(--treasure-text-light);
    background: var(--treasure-bg-body);
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

/* ====== 鏃х増鍒嗙被鍗＄墖锛堜繚鐣欏吋瀹癸級 ====== */

/* 鍒嗙被鍗＄墖缃戞牸 */
.treasure-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 20px;
    max-width: 400px;
    margin: 0 auto;
}

.treasure-cat-card {
    background: linear-gradient(135deg, #ffffff 0%, #fffbf7 100%);
    border: 1px solid rgba(255, 159, 67, 0.1);
    border-radius: 16px;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(92, 75, 67, 0.05);
}

.treasure-cat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 24px rgba(255, 159, 67, 0.15);
    border-color: rgba(255, 159, 67, 0.3);
}

.treasure-cat-card:active {
    transform: translateY(-2px) scale(0.98);
}

.treasure-cat-card i {
    font-size: 36px;
    color: var(--treasure-theme-orange);
    transition: transform 0.3s;
}

.treasure-cat-card:hover i {
    transform: scale(1.15);
}

.treasure-cat-card span {
    font-size: 14px;
    font-weight: 600;
    color: var(--treasure-text-dark);
}

/* 鍔犺浇鏇村鎸夐挳鍖哄煙 */
.treasure-load-more-box {
    display: flex;
    justify-content: center;
    padding: 24px 16px;
    background: var(--treasure-bg-body);
}

.treasure-btn-load-more {
    background: #fff;
    color: #5c4b43;
    border: 2px solid rgba(255, 159, 67, 0.2);
    border-radius: 24px;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(92, 75, 67, 0.08);
    transition: all 0.3s;
}

.treasure-btn-load-more i {
    color: #ff9f43;
    font-size: 18px;
}

.treasure-btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92, 75, 67, 0.12);
    border-color: rgba(255, 159, 67, 0.4);
}

.treasure-btn-load-more:active {
    transform: translateY(0);
}

/* 楠ㄦ灦灞?*/
.treasure-skeleton-card {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--treasure-shadow-card);
    overflow: hidden;
}

.treasure-skeleton-img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

.treasure-skeleton-text {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 涓绘粴鍔ㄥ尯鍩?*/
.treasure-main-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: calc(var(--treasure-nav-height) + var(--treasure-safe-bottom) + 20px);
    position: relative; /* 涓鸿儗鍖呯晫闈㈡彁渚涘畾浣嶅弬鑰?*/
}

.treasure-view-section {
    display: none !important;
    flex: 1;
    overflow-y: auto;
    animation: treasurePopIn 0.3s ease-out;
    position: relative; /* 寤虹珛瀹氫綅涓婁笅鏂?*/
    height: 100%;
}

.treasure-view-section.active {
    display: flex !important;
    flex-direction: column;
}

/* 鐗瑰埆澶勭悊璁㈠崟椤甸潰锛氱‘淇濈粷瀵瑰畾浣嶅瓙鍏冪礌琚殣钘?*/
#treasure-view-orders {
    overflow: hidden !important;
}

#treasure-view-orders:not(.active) {
    visibility: hidden !important;
    pointer-events: none !important;
}

#treasure-view-orders:not(.active) * {
    visibility: hidden !important;
    pointer-events: none !important;
}

@keyframes treasurePopIn {
    0% { opacity: 0; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* 鍒嗙被鏍囩 */
.treasure-cat-scroll {
    display: flex;
    gap: 12px;
    padding: 0 16px 16px 16px;
    overflow-x: auto;
}

.treasure-cat-pill {
    padding: 8px 16px;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    color: var(--treasure-text-light);
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.treasure-cat-pill.active {
    background: var(--treasure-text-dark);
    color: #fff;
    font-weight: 600;
}

/* 鐎戝竷娴?*/
.treasure-waterfall {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 24px;
    min-height: 400px;
    background: var(--treasure-bg-body);
}

.treasure-w-card {
    background: #fff;
    border-radius: var(--treasure-radius-card);
    overflow: hidden;
    box-shadow: var(--treasure-shadow-card);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s;
}

.treasure-w-card:active {
    transform: scale(0.98);
}

.treasure-w-img-box {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    background: #fdfbf9;
}

.treasure-w-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.treasure-warm-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(255,255,255,0.9);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--treasure-theme-orange);
    backdrop-filter: blur(4px);
}

.treasure-w-info {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.treasure-w-title {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--treasure-text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.treasure-w-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.treasure-w-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--treasure-theme-orange);
}

.treasure-w-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--treasure-bg-body);
    color: var(--treasure-text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.treasure-w-btn:hover {
    background: var(--treasure-theme-orange);
    color: #fff;
}

/* 璐墿杞?*/
.treasure-cart-group {
    padding: 16px;
}

.treasure-cart-item {
    background: #fff;
    padding: 12px;
    border-radius: var(--treasure-radius-card);
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    box-shadow: var(--treasure-shadow-card);
}

.treasure-c-check {
    font-size: 20px;
    margin-right: 12px;
    color: #ddd;
    cursor: pointer;
}

.treasure-c-check.checked {
    color: var(--treasure-theme-orange);
}

.treasure-c-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: #fdfbf9;
    object-fit: cover;
    margin-right: 12px;
}

.treasure-c-main {
    flex: 1;
}

.treasure-c-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--treasure-text-dark);
}

.treasure-c-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.treasure-c-price {
    color: var(--treasure-theme-orange);
    font-weight: 700;
}

.treasure-c-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.treasure-c-btn {
    cursor: pointer;
    font-size: 18px;
    color: var(--treasure-text-dark);
    transition: all 0.3s;
    padding: 4px;
}

.treasure-c-btn:hover {
    color: var(--treasure-theme-orange);
    transform: scale(1.1);
}

.treasure-c-btn:active {
    transform: scale(0.95);
}

.treasure-c-delete {
    color: #e74c3c;
    margin-left: 4px;
}

.treasure-c-delete:hover {
    color: #c0392b;
}

.treasure-c-num {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    color: var(--treasure-text-dark);
}

/* 缁撶畻鏉?*/
.treasure-pay-bar {
    position: fixed;
    bottom: calc(var(--treasure-nav-height) + var(--treasure-safe-bottom) + 12px);
    left: 16px;
    right: 16px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(92, 75, 67, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 99;
}

.treasure-pay-total {
    font-size: 12px;
    color: var(--treasure-text-light);
}

.treasure-pay-amount {
    font-size: 18px;
    font-weight: 800;
    color: var(--treasure-theme-orange);
}

.treasure-btn-pay {
    background: var(--treasure-theme-gradient);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--treasure-theme-btn-shadow);
    cursor: pointer;
}

/* 璁㈠崟鍗＄墖 */
.treasure-order-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(92, 75, 67, 0.05);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.treasure-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(92, 75, 67, 0.08);
}

.treasure-order-card:active {
    transform: translateY(0);
}

/* 鏃ф牱寮忎繚鐣欙紙鐢ㄤ簬鍏煎锛?*/
.treasure-order-box {
    background: #fff;
    margin: 16px;
    padding: 16px;
    border-radius: var(--treasure-radius-card);
    box-shadow: var(--treasure-shadow-card);
}

.treasure-o-head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--treasure-text-light);
    padding-bottom: 8px;
    border-bottom: 1px solid #f2efeb;
    margin-bottom: 12px;
}

.treasure-o-stat {
    color: var(--treasure-theme-orange);
    font-weight: 600;
}

.treasure-o-body {
    display: flex;
    gap: 12px;
}

.treasure-o-pic {
    width: 60px;
    height: 60px;
    background: #fdfbf9;
    border-radius: 6px;
}

.treasure-o-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.treasure-o-btn {
    margin-top: 12px;
    text-align: right;
}

.treasure-btn-unbox {
    padding: 8px 16px;
    border: 1px solid var(--treasure-theme-orange);
    background: var(--treasure-theme-gradient);
    color: #fff;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--treasure-theme-btn-shadow);
}

/* 閽卞寘 */
.treasure-wallet-card {
    margin: 16px;
    height: 160px;
    border-radius: 20px;
    background: var(--treasure-text-dark);
    color: #fff;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(92, 75, 67, 0.3);
}

.treasure-bg-deco {
    position: absolute;
    right: -20px;
    top: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255,159,67,0.2);
    border-radius: 50%;
    filter: blur(20px);
}

.treasure-w-label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.treasure-w-money {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.treasure-w-actions {
    display: flex;
    gap: 12px;
}

.treasure-w-act-btn {
    background: rgba(255,255,255,0.15);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.treasure-trans-list {
    background: #fff;
    margin: 0 16px;
    padding: 16px;
    border-radius: var(--treasure-radius-card);
    box-shadow: var(--treasure-shadow-card);
}

.treasure-t-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #f2efeb;
}

.treasure-t-item:last-child {
    border: none;
}

.treasure-t-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.treasure-t-icon {
    width: 32px;
    height: 32px;
    background: #fff8e1;
    color: var(--treasure-theme-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搴曢儴瀵艰埅 */
.treasure-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--treasure-nav-height) + var(--treasure-safe-bottom));
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    padding-top: 10px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    z-index: 100;
}

.treasure-nav-icon {
    text-align: center;
    color: #ccc;
    transition: 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
    cursor: pointer;
}

.treasure-nav-icon i {
    display: block;
    font-size: 24px;
    margin-bottom: 2px;
}

.treasure-nav-icon span {
    font-size: 10px;
    font-weight: 600;
    display: block;
    transform: scale(0.9);
}

.treasure-nav-icon.active {
    color: var(--treasure-theme-orange);
    transform: translateY(-4px);
}

.treasure-nav-icon.active i {
    font-weight: 600;
}

/* 鎷嗙鍔ㄧ敾 */
/* ========== 鎷嗙鍔ㄧ敾绯荤粺 ========== */
/* V1拆箱overlay已移除 - 使用 treasure-unbox-v2.css */

/* 通用琳琅动画（仓库弹窗等使用） */
@keyframes treasureSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes treasureFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 3D 鐩掑瓙瀹瑰櫒 */
/* V1拆箱盒子样式已移除 */

/* 鐩掑瓙鐩栧瓙 */
/* V1盖子/提示/摇晃样式已移除 */

/* 鐩栧瓙椋炲嚭鍔ㄧ敾 */
/* V1 treasureLidFly 已移除 */

/* 鐩掑瓙鏈綋娣″嚭 */
/* V1 treasureBoxFade 已移除 */

/* 鍏夎姃鐖嗗彂 */
/* V1 .treasure-light-burst 已移除 */

/* 鍟嗗搧灞曠ず */
/* V1 .treasure-item-reveal 已移除 */

/* 鍟嗗搧鍚嶇О */
/* V1 .treasure-item-name-reveal / treasureFadeInUp 已移除 */

/* 鏃х殑鎷嗙鏍峰紡锛堝吋瀹逛繚鐣欙級 */
/* V1 旧版拆箱样式全部已移除 */

/* Toast - 极光幻白珍珠水滴样式 */
.treasure-toast,
.sayoo-toast-aurora {
    display: inline-flex;
    align-items: center;
    padding: 6px 24px 6px 6px;
    gap: 12px;
    border-radius: 99px 24px 8px 99px;
    background: linear-gradient(110deg, rgba(255,255,255,0.95), rgba(245,235,250,0.85), rgba(225,245,255,0.85));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 2px 3px rgba(255,255,255,0.9), 
        inset 0 -1px 2px rgba(0,0,0,0.02),
        0 6px 16px rgba(180, 190, 210, 0.25);
    border: 1px solid rgba(255,255,255,0.7);
    z-index: 99999;
}

.treasure-toast.show,
.sayoo-toast-aurora.show {
    opacity: 1;
}

/* 馃帹 AI 鍥剧墖鍔犺浇鐘舵€?*/
.treasure-w-img-box.treasure-loading {
    position: relative;
    background: linear-gradient(135deg, #f9f6f2 0%, #fef8f4 100%);
}

.treasure-img-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d4a574;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    animation: pulse 1.5s ease-in-out infinite;
}

.treasure-w-img-box.treasure-loading img {
    opacity: 0;
}

.treasure-w-img-box:not(.treasure-loading) img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.treasure-w-img-box:not(.treasure-loading) .treasure-img-loading {
    display: none;
}

/* 璐墿杞﹀拰璁㈠崟涓殑鍥剧墖鍔犺浇鐘舵€?*/
.treasure-c-img-box.loading,
.treasure-o-pic-box.loading {
    position: relative;
    background: #f5f5f5;
}

.treasure-c-img-box.loading::after,
.treasure-o-pic-box.loading::after {
    content: "...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 20px;
    font-weight: 700;
}

/* 鎷嗙寮圭獥鍥剧墖鍔犺浇鐘舵€?*/
/* V1 .treasure-unbox-img-box 已移除 */

/* ========== 鍟嗗搧璇︽儏椤?========== */
.treasure-detail-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f9f6f2;
    z-index: 9999;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.treasure-detail-page.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* 璇︽儏椤靛ご閮?*/
.treasure-detail-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.treasure-detail-header i {
    font-size: 24px;
    color: #5c4b43;
    cursor: pointer;
}

.treasure-detail-header span {
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 600;
    opacity: 0.6;
    color: #5c4b43;
}

/* 璇︽儏椤靛唴瀹?*/
.treasure-detail-content {
    padding: 0 24px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
}

.treasure-detail-img-box {
    background: #fff;
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(92, 75, 67, 0.08);
    margin-bottom: 30px;
}

.treasure-detail-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #f9f6f2;
    border-radius: 12px;
    overflow: hidden;
}

.treasure-detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 鍟嗗搧淇℃伅 */
.treasure-detail-info {
    text-align: center;
    margin-bottom: 30px;
}

.treasure-detail-badge {
    font-size: 12px;
    color: #ff9f43;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.treasure-detail-name {
    font-size: 26px;
    font-weight: 800;
    color: #5c4b43;
    margin-bottom: 10px;
    line-height: 1.2;
}

.treasure-detail-price {
    font-size: 18px;
    color: #a69b95;
}

/* 璇︽儏鍙傛暟 */
.treasure-detail-specs {
    display: flex;
    justify-content: space-between;
    border-top: 1px dashed #e0dcd5;
    border-bottom: 1px dashed #e0dcd5;
    padding: 20px 0;
    margin-bottom: 20px;
}

.treasure-detail-spec {
    text-align: center;
    flex: 1;
}

.treasure-detail-spec-label {
    font-size: 12px;
    color: #a69b95;
}

.treasure-detail-spec-value {
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
    color: #5c4b43;
}

.treasure-detail-specs .treasure-detail-spec:not(:last-child) {
    border-right: 1px solid #e0dcd5;
}

/* 鍟嗗搧鎻忚堪 */
.treasure-detail-desc {
    font-size: 13px;
    color: #5c4b43;
    line-height: 1.8;
    text-align: justify;
}

/* 璇︽儏椤靛簳閮ㄦ寜閽?*/
.treasure-detail-footer {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
}

.treasure-detail-btn-add {
    width: 100%;
    background: #5c4b43;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(92, 75, 67, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.treasure-detail-btn-add i {
    margin-left: 8px;
}

.treasure-detail-btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(92, 75, 67, 0.25);
}

.treasure-detail-btn-add:active {
    transform: translateY(0);
}

/* ========== 鐗╂祦璁㈠崟椤甸潰鍔ㄧ敾 ========== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes truck-bounce {
    0%, 100% {
        transform: translate(-50%, -50%);
    }
    50% {
        transform: translate(-50%, -55%);
    }
}

/* 璁㈠崟椤甸潰杩囨浮鍔ㄧ敾 */
.treasure-order-page-transition {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f9f6f2;
    display: flex;
    flex-direction: column;
}

/* 璁㈠崟鍒楄〃椤?*/
.treasure-order-list-page {
    z-index: 10;
}

/* 璁㈠崟璇︽儏椤?*/
.treasure-order-detail-page {
    transform: translateX(100%);
    z-index: 20;
}

.treasure-order-detail-page.active {
    transform: translateX(0);
}

/* 鐗╂祦鍦板浘瀹瑰櫒 */
.treasure-logistics-map {
    height: 200px;
    position: relative;
    background-color: #fffdf5;
    background-image: radial-gradient(#e0dcd5 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: hidden;
    flex-shrink: 0;
}

/* 娴姩浜戞湹 */
.treasure-cloud {
    position: absolute;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

.treasure-cloud.cloud-2 {
    animation: float 4s ease-in-out infinite reverse;
    opacity: 0.6;
}

/* 鍗¤溅鍔ㄧ敾 */
.treasure-truck {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #ff9f43;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(255, 159, 67, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 5;
    animation: truck-bounce 2s infinite;
}

/* 鐗╂祦鏃堕棿杞?*/
.treasure-timeline {
    position: relative;
    padding-left: 10px;
}

.treasure-timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.treasure-timeline-dot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.treasure-timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    z-index: 2;
}

.treasure-timeline-dot.active {
    background: #ff9f43;
    border: 4px solid #fcebd9;
}

.treasure-timeline-dot.inactive {
    width: 10px;
    height: 10px;
    background: #dcd6d0;
}

.treasure-timeline-line {
    width: 2px;
    flex: 1;
    background: #e0dcd5;
    margin: 4px 0;
}

.treasure-timeline-content {
    padding-bottom: 10px;
}

.treasure-timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: #5c4b43;
    margin-bottom: 4px;
}

.treasure-timeline-title.inactive {
    font-weight: 600;
    color: #a69b95;
}

.treasure-timeline-desc {
    font-size: 12px;
    color: #5c4b43;
    line-height: 1.5;
}

.treasure-timeline-desc.inactive {
    color: #a69b95;
}

.treasure-timeline-time {
    font-size: 11px;
    color: #a69b95;
    margin-top: 4px;
}

/* 璁㈠崟椤甸潰瀹瑰櫒寮哄埗淇 */
#treasure-view-orders {
    height: 100% !important;
    min-height: 500px !important;
    width: 100% !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 10;
    background: #f9f6f2;
    overflow: hidden !important;
}

/* 闈炴椿鍔ㄦ椂瀹屽叏闅愯棌璁㈠崟椤?*/
#treasure-view-orders:not(.active) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#treasure-view-orders:not(.active) * {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 鍒楄〃椤靛鍣?*/
#treasure-order-list-page {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 鍒楄〃婊氬姩瀹瑰櫒 */
#treasure-order-list {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 10px 20px 20px !important;
    min-height: 200px !important;
}

/* 璇︽儏椤靛鍣?*/
#treasure-order-detail-page {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 椤甸潰杩囨浮瀹瑰櫒 */
.treasure-order-page-transition {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto !important;
    /* 闄愬埗锛氬彧鍦ㄧ埗瀹瑰櫒 #treasure-view-orders.active 涓敓鏁?*/
}

/* 闈炴椿鍔ㄨ鍗曢〉锛氱鐢ㄦ墍鏈夎繃娓″鍣?*/
#treasure-view-orders:not(.active) .treasure-order-page-transition {
    display: none !important;
    pointer-events: none !important;
}

/* 纭繚璁㈠崟鍗＄墖鍙 */
.treasure-order-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   馃敡 寮哄埗淇锛氬洖鍝嶈亰澶╂皵娉℃牱寮?   鍙傝€冿細缇庡寲/鍗曡亰.html & 缇庡寲/缇よ亰.html
   闂锛氭皵娉¤儗鏅涪澶憋紝鍙樉绀烘枃瀛?   瑙ｅ喅锛氬己鍒跺簲鐢ㄦ按婊寸幓鐠冩牱寮?   ======================================== */

/* === 1. 鍩虹姘旀场鏍峰紡锛堝己鍒讹級 === */
.msg-bubble {
    max-width: calc(100% - 54px) !important;
    width: fit-content !important;
    min-width: 60px !important;
    padding: 12px 18px !important;
    border-radius: 20px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    position: relative !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

.speech-bubble {
    max-width: 100% !important;
    width: fit-content !important;
    padding: 12px 18px !important;
    border-radius: 20px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    position: relative !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

/* === 2. 瀵规柟姘旀场锛堢（鐮傜櫧鐜荤拑锛?=== */
.msg-row.other .msg-bubble,
.msg-row.other .speech-bubble {
    color: #546e7a !important;
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 
        5px 5px 15px rgba(166, 171, 189, 0.3), 
        inset 2px 2px 5px #fff, 
        inset -2px -2px 5px rgba(166, 171, 189, 0.1) !important;
    border-bottom-left-radius: 4px !important;
}

/* === 3. 鎴戞柟姘旀场锛堟按婊磋摑娓愬彉锛?=== */
.msg-row.me .msg-bubble,
.msg-row.me .speech-bubble {
    color: #0d47a1 !important;
    background: linear-gradient(135deg, rgba(227, 242, 253, 0.8), rgba(187, 222, 251, 0.6)) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 
        4px 8px 20px rgba(33, 150, 243, 0.25), 
        inset 3px 3px 6px #fff, 
        inset -2px -2px 8px rgba(33, 150, 243, 0.1) !important;
    border-bottom-right-radius: 4px !important;
}

/* === 4. 鎴戞柟姘旀场楂樺厜鏁堟灉 === */
.msg-row.me .msg-bubble::before,
.msg-row.me .speech-bubble::before {
    content: "" !important;
    position: absolute !important;
    top: 6px !important;
    left: 8px !important;
    width: 25px !important;
    height: 12px !important;
    border-radius: 20px !important;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 70%) !important;
    transform: rotate(-15deg) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* === 5. 缇よ亰鍚嶅瓧鏍囩锛堢幓鐠冮鏍硷級 === */
/* === 5. 群聊名字标签（玻璃风格） === */
.name-tag {
    position: absolute !important;
    top: -14px !important;
    left: 0 !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.05) !important;
    z-index: 2 !important;
}

.msg-row.me .name-tag {
    left: auto !important;
    right: 0 !important;
    background: rgba(13, 71, 161, 0.1) !important;
    color: #0d47a1 !important;
}

.msg-row.other .name-tag {
    background: rgba(255,255,255,0.7) !important;
    color: #546e7a !important;
}

/* === 6. 头像容器（用于定位名字标签） === */
.avatar-wrap {
    position: relative !important;
    flex-shrink: 0 !important;
}

/* === 7. 纭繚褰掓。娑堟伅涓嶅彈褰卞搷 === */
.archived-bubble,
.archived-content .speech-bubble {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.archived-bubble::before,
.archived-content .speech-bubble::before {
    display: none !important;
    content: none !important;
}

/* === 8. 鍔ㄤ綔鎻忓啓鏍峰紡淇濇寔涓嶅彉 === */
.action-text {
    font-style: italic !important;
    opacity: 0.85 !important;
}

/* === 9. 纭繚msg-content瀹瑰櫒涓嶅共鎵?=== */
.msg-content {
    max-width: calc(100% - 54px) !important;
    width: fit-content !important;
    min-width: 60px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

/* === 10. 淇鏃х殑.bubble绫伙紙鍏煎锛?=== */
.bubble {
    padding: 12px 18px !important;
    border-radius: 20px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 5px 5px 15px rgba(166, 171, 189, 0.3), inset 2px 2px 5px #fff !important;
}

/* ========================================
    鏈嬪弸鍦堢敤鎴峰ご鍍忕紪杈戝姛鑳?   ======================================== */

/* 澶村儚瀹瑰櫒 */
.moments-avatar-wrapper {
    position: relative !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.moments-avatar-wrapper:hover {
    transform: scale(1.05) !important;
}

.moments-avatar-wrapper:hover .avatar-edit-badge {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* 缂栬緫寰界珷 */
.avatar-edit-badge {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: var(--primary-color) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    opacity: 0 !important;
    transform: scale(0.8) !important;
    transition: all 0.3s ease !important;
    border: 2px solid white !important;
}

/* 澶村儚缂栬緫鑿滃崟 */
.avatar-edit-menu {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 20px !important;
    padding-bottom: 30px !important;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15) !important;
    z-index: 10000 !important;
    transform: translateY(100%) !important;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.avatar-edit-menu.show {
    transform: translateY(0) !important;
}

/* 鑿滃崟椤?*/
.avatar-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,0.7) !important;
    margin-bottom: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    font-size: 16px !important;
    color: var(--text-main) !important;
}

.avatar-menu-item:hover {
    background: rgba(255,255,255,1) !important;
    border-color: var(--primary-color) !important;
    transform: translateX(5px) !important;
}

.avatar-menu-item:active {
    transform: translateX(5px) scale(0.98) !important;
}

.avatar-menu-item i {
    font-size: 22px !important;
    color: var(--primary-color) !important;
}

.avatar-menu-item.cancel {
    background: rgba(255,0,0,0.08) !important;
    color: #ff3b30 !important;
    margin-top: 5px !important;
}

.avatar-menu-item.cancel i {
    color: #ff3b30 !important;
}

/* ========== 千面人设切换面板 ========== */
.persona-action-sheet {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.persona-sheet-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0);
    transition: background 0.3s;
}
.persona-action-sheet.show .persona-sheet-mask {
    background: rgba(0,0,0,0.35);
}
.persona-sheet-panel {
    position: relative;
    z-index: 1;
    background: rgba(245,245,247,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
    max-height: 55vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.persona-action-sheet.show .persona-sheet-panel {
    transform: translateY(0);
}
.persona-sheet-title {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 14px;
}
.persona-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.75);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    border: 1.5px solid transparent;
}
.persona-sheet-item:active { transform: scale(0.97); }
.persona-sheet-item.active {
    border-color: #6c5ce7;
    background: rgba(108,92,231,0.08);
}
.persona-sheet-item.active i {
    color: #6c5ce7;
    margin-left: auto;
    font-size: 18px;
}
.persona-sheet-item img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.persona-sheet-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}
.persona-sheet-item.cancel {
    justify-content: center;
    background: rgba(255,59,48,0.06);
    margin-top: 4px;
}
.persona-sheet-item.cancel .persona-sheet-name {
    color: #ff3b30;
}
.persona-sheet-item.cancel i {
    color: #ff3b30;
    font-size: 18px;
}

.avatar-menu-item.cancel:hover {
    background: rgba(255,0,0,0.15) !important;
    border-color: #ff3b30 !important;
}

.avatar-menu-item span {
    flex: 1 !important;
    font-weight: 600 !important;
}
/* ========================================
    寮哄埗淇Moments澶撮儴鎺掔増
   ======================================== */
.moments-page .header {
    position: relative !important;
    z-index: 100 !important;
    padding: 20px 20px 15px !important;
    background: transparent !important;
    margin-bottom: -20px !important;
}

.moments-page .header .circle-btn {
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(255,255,255,0.9) !important;
    z-index: 101 !important;
}

/* 灏侀潰鍖哄煙涓嶉伄鎸eader */
.moments-cover-area {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ========================================
   缇ゅご鍍忎節瀹牸鏍峰紡锛堝眳涓榻?鐧借竟锛?   ======================================== */
.group-avatar-grid,
.group-avatar-grid-list {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important; /* 鍏抽敭锛氬眳涓榻?*/
    align-content: center !important;
    background: #fff !important; /* 绾櫧搴?*/
    border-radius: 50% !important;
    overflow: hidden !important;
    padding: 2px !important; /* 鍐呰竟璺?*/
    box-sizing: border-box !important;
}

.group-avatar-grid img,
.group-avatar-grid-list img {
    box-sizing: border-box !important;
    border: 1px solid #fff !important; /* 鐢ㄧ櫧杈逛唬鏇?margin */
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

/* ========================================
   代付卡片与礼物气泡样式
   ======================================== */

/* === 亮色系主题变量 === */
:root {
    --card-bg: #ffffff;
    --text-main-pay: #333333;
    --text-sub-pay: #888888;
    
    /* 渐变色 - 我 (蓝) */
    --accent-blue-start: #4facfe;
    --accent-blue-end: #00f2fe;
    
    /* 渐变色 - 对方 (粉橙) */
    --accent-orange-start: #ff758c;
    --accent-orange-end: #ff7eb3;

    /* 弥散阴影 */
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
}

/* === 核心：代付卡片样式 === */
.pay-card {
    width: 250px; 
    background: var(--card-bg); 
    border-radius: 18px; 
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

/* 头部渐变区分 */
/* 发送方 (右侧) - 蓝色 */
.msg-right .pay-card .pc-header { 
    background: linear-gradient(135deg, var(--accent-blue-start), var(--accent-blue-end)); 
}
/* 接收方 (左侧) - 粉橙色 */
.msg-left .pay-card .pc-header { 
    background: linear-gradient(135deg, var(--accent-orange-start), var(--accent-orange-end)); 
}

.pc-header {
    padding: 15px; 
    color: #fff; 
    font-size: 13px; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
}

.pc-body { 
    padding: 20px 16px; 
    text-align: center; 
}

.pc-title { 
    font-size: 14px; 
    color: var(--text-sub-pay); 
    margin-bottom: 4px; 
}

.pc-amount { 
    font-size: 32px; 
    font-weight: 700; 
    color: var(--text-main-pay); 
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif; 
    letter-spacing: -0.5px;
}

.pc-desc { 
    font-size: 12px; 
    color: #999; 
    margin-top: 8px; 
    background: #f7f7f7; 
    padding: 4px 10px; 
    border-radius: 20px; 
    display: inline-block;
}

/* 底部按钮 */
.pc-footer {
    padding: 14px; 
    text-align: center; 
    font-weight: 600; 
    font-size: 14px;
    border-top: 1px solid #f0f0f0; 
    cursor: pointer; 
    transition: 0.2s;
}

/* 接收方按钮强调色 */
.msg-left .pay-card .pc-footer { 
    color: #ff758c; 
}
.msg-left .pay-card .pc-footer:hover { 
    background: #fff5f7; 
}

/* 发送方按钮置灰 */
.msg-right .pay-card .pc-footer { 
    color: #ccc; 
    cursor: default; 
}

/* === 状态：已支付 (Paid) === */
.pay-card.paid {
    filter: grayscale(100%); 
    opacity: 0.7;
    box-shadow: none; 
    border: 1px solid #eee;
}

.pay-card.paid .pc-footer { 
    text-decoration: line-through; 
    pointer-events: none; 
}

/* 盖章动画 */
.stamp-paid {
    position: absolute; 
    right: 10px; 
    bottom: 50px;
    width: 90px; 
    height: 90px;
    border: 4px solid #333; 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 20px; 
    font-weight: 900; 
    color: #333;
    transform: rotate(-25deg) scale(2); 
    opacity: 0;
    pointer-events: none; 
    mix-blend-mode: multiply;
}

.pay-card.paid .stamp-paid {
    animation: stampAnim 0.4s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

@keyframes stampAnim { 
    to { 
        transform: rotate(-25deg) scale(1); 
        opacity: 0.6; 
    } 
}

/* === 礼物气泡样式 === */
.gift-bubble {
    padding: 10px 14px; 
    border-radius: 16px;
    display: flex; 
    align-items: center; 
    gap: 10px;
    box-shadow: var(--shadow-soft); 
    max-width: 220px;
    background: #fff;
}

.msg-right .gift-bubble { 
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); 
    color: #fff; 
}

.gift-icon { 
    font-size: 32px; 
}

.gift-info div:first-child { 
    font-size: 12px; 
    opacity: 0.8; 
}

.gift-info div:last-child { 
    font-size: 15px; 
    font-weight: 600; 
}

/* ========================================= */
/* === AI 交互按钮摇晃动画 === */
/* ========================================= */

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.wobbling {
    animation: wobble 0.3s ease-in-out infinite !important;
    color: #ff9f43 !important; /* 摇晃时变橙色，更显眼 */
    transform-origin: center bottom !important; /* 从底部中心旋转 */
}

/* 礼物闪光动画 */
@keyframes shine {
    0%, 100% {
        left: -10px;
        opacity: 0;
    }
    50% {
        left: calc(100% + 10px);
        opacity: 1;
    }
}

/* ========================================= */
/* === 哑光钱包弹窗样式 (Matte Wallet Modal) === */
/* ========================================= */

/* 弹窗遮罩层 - 限制在手机屏幕内 */
#modal-wallet.overlay {
    position: absolute !important; /* 相对于 #app-echo 定位 */
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    z-index: 9999; /* 确保在页面内容之上 */
    display: none; /* 默认隐藏 */
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 显示状态 */
#modal-wallet.overlay.active {
    display: flex; /* 激活时显示 */
    opacity: 1;
    visibility: visible;
}

/* 弹窗主体 */
#modal-wallet .sheet {
    width: 100%;
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    padding: 28px;
    padding-bottom: 50px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.05);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

/* 弹窗显示时的动画 */
#modal-wallet.overlay.active .sheet {
    transform: translateY(0);
}

#modal-wallet .sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

#modal-wallet .sheet-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #111;
}

#modal-wallet .close-icon {
    font-size: 26px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 50%;
}

#modal-wallet .close-icon:hover {
    color: #333;
    background: #f5f5f5;
}

/* === 哑光卡片 (Matte Card) === */
#modal-wallet .bank-card {
    height: 190px;
    padding: 26px;
    border-radius: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #5b6e88 0%, #3e4a5b 100%);
    box-shadow: 0 15px 35px rgba(62, 74, 91, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 纹理效果 */
#modal-wallet .bank-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 100% 20px;
    opacity: 0.3;
    pointer-events: none;
}

#modal-wallet .card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

#modal-wallet .chip {
    width: 36px;
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(#e0caa0, #c8b080);
    opacity: 0.9;
}

#modal-wallet .brand {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.9;
}

#modal-wallet .card-mid {
    z-index: 2;
}

#modal-wallet .label {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modal-wallet .balance {
    font-size: 34px;
    font-weight: 500;
    font-family: "SF Pro Display", -apple-system, sans-serif;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#modal-wallet .card-btm {
    z-index: 2;
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.7);
    font-family: "SF Mono", monospace;
    font-size: 14px;
}

/* === 功能按钮 (极简灰) === */
#modal-wallet .action-grid {
    display: flex;
    justify-content: space-between;
    margin: 32px 10px;
}

#modal-wallet .action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#modal-wallet .action-item:active {
    transform: scale(0.96);
    opacity: 0.8;
}

#modal-wallet .icon-box {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: #f7f7f9;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

#modal-wallet .action-item:hover .icon-box {
    background: #eeeff2;
    transform: translateY(-2px);
}

#modal-wallet .action-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* === 交易列表 (干净) === */
#modal-wallet .section-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
    font-weight: 500;
}

#modal-wallet .trans-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f2f2f2;
    transition: background 0.2s ease;
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 8px;
}

#modal-wallet .trans-item:hover {
    background: #fafafa;
}

#modal-wallet .trans-item:last-child {
    border-bottom: none;
}

#modal-wallet .t-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f2f2f7;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 18px;
}

#modal-wallet .t-main {
    flex: 1;
}

#modal-wallet .t-name {
    font-size: 15px;
    font-weight: 500;
    color: #222;
}

#modal-wallet .t-desc {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

#modal-wallet .t-price {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    font-feature-settings: "tnum";
}

/* ========== 万象预设操作弹窗优化 ========== */
/* 选项列表交互增强 */
.option-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

.option-item:active {
    background: rgba(0, 0, 0, 0.08) !important;
}

body.dark-mode .option-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .option-item:active {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* 关闭按钮样式 - 右上角圆形X按钮 */
#modal-close-btn {
    transition: all 0.2s ease !important;
}

#modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-50%) scale(1.05) !important;
}

#modal-close-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
    background: rgba(0, 0, 0, 0.12) !important;
}

body.dark-mode #modal-close-btn {
    background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode #modal-close-btn:active {
    background: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode #modal-close-btn i {
    color: #ccc !important;
}

/* ==================== 背包送礼面板 ==================== */
.echo-gift-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 10000; display: flex; align-items: flex-end;
    animation: echoGiftFadeIn 0.25s ease;
}
@keyframes echoGiftFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes echoGiftSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes echoGiftSlideRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

.echo-gift-panel {
    width: 100%; background: #eff3f6; border-radius: 28px 28px 0 0;
    padding: 20px 18px 32px; box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
    display: flex; flex-direction: column; max-height: 80vh; overflow: hidden;
    animation: echoGiftSlideUp 0.35s cubic-bezier(0.2,0.8,0.2,1);
    position: relative;
}
.echo-gift-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-shrink: 0;
}
.echo-gift-title {
    font-size: 17px; font-weight: 700; color: #546e7a;
    display: flex; align-items: center; gap: 8px;
}
.echo-gift-btn-history {
    font-size: 12px; color: #0d47a1; background: rgba(13,71,161,0.08);
    padding: 7px 12px; border-radius: 12px; cursor: pointer; font-weight: 600;
    transition: 0.2s; display: flex; align-items: center; gap: 4px;
}
.echo-gift-btn-history:active { transform: scale(0.95); }

/* 对象选择区 */
.echo-gift-section-title {
    font-size: 11px; color: #90a4ae; margin-bottom: 8px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase; flex-shrink: 0;
}
.echo-recipient-single {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.9);
    border-radius: 14px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); flex-shrink: 0;
}
.echo-recipient-single img {
    width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05); object-fit: cover;
}
.echo-recipient-single .r-info { flex: 1; }
.echo-recipient-single .r-name { font-size: 14px; font-weight: 600; color: #546e7a; margin-bottom: 2px; }
.echo-recipient-single .r-desc { font-size: 11px; color: #90a4ae; }

.echo-recipient-group {
    display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px;
    margin-bottom: 10px; scrollbar-width: none; flex-shrink: 0;
}
.echo-recipient-group::-webkit-scrollbar { display: none; }
.echo-recipient-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    opacity: 0.5; transition: 0.2s; cursor: pointer; min-width: 52px;
}
.echo-recipient-item.active { opacity: 1; transform: scale(1.05); }
.echo-recipient-item img {
    width: 48px; height: 48px; border-radius: 50%; border: 2px solid transparent;
    transition: 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.05); object-fit: cover;
}
.echo-recipient-item.active img { border-color: #0d47a1; box-shadow: 0 4px 12px rgba(13,71,161,0.2); }
.echo-recipient-item span { font-size: 11px; color: #546e7a; font-weight: 600; max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

/* 背包网格 */
.echo-gift-grid-header {
    font-size: 11px; color: #90a4ae; margin-bottom: 8px; font-weight: 600;
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.echo-gift-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    overflow-y: auto; padding: 2px; max-height: 260px; scrollbar-width: none; flex: 1;
}
.echo-gift-grid::-webkit-scrollbar { display: none; }
.echo-gift-item {
    background: rgba(255,255,255,0.7); border: 2px solid rgba(255,255,255,0.9);
    border-radius: 14px; padding: 12px 4px; display: flex; flex-direction: column;
    align-items: center; cursor: pointer; transition: 0.2s;
    box-shadow: 0 3px 8px rgba(0,0,0,0.02); position: relative;
}
.echo-gift-item:active { transform: scale(0.96); }
.echo-gift-item.selected {
    background: rgba(13,71,161,0.06); border-color: #0d47a1;
    box-shadow: 0 4px 14px rgba(13,71,161,0.12); transform: translateY(-2px);
}
.echo-gift-item.empty { opacity: 0.4; filter: grayscale(0.8); cursor: not-allowed; }
.echo-gift-badge {
    position: absolute; top: -5px; right: -3px; background: #e57373; color: #fff;
    font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px;
    border: 2px solid #eff3f6; box-shadow: 0 2px 4px rgba(229,115,115,0.3); min-width: 16px; text-align: center;
}
.echo-gift-item.empty .echo-gift-badge { background: #b0bec5; }
.echo-gift-emoji { font-size: 28px; margin-bottom: 4px; }
.echo-gift-img-wrap {
    width: 52px; height: 52px; border-radius: 10px; overflow: hidden;
    margin-bottom: 4px; position: relative; background: #f8f9fa;
}
.echo-gift-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.echo-gift-img-fallback {
    width: 100%; height: 100%; align-items: center; justify-content: center; overflow: hidden;
}
.echo-gift-name {
    font-size: 11px; font-weight: 600; color: #546e7a; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
.echo-gift-stock { font-size: 10px; color: #90a4ae; font-weight: 500; }

/* 空背包 */
.echo-gift-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 20px; gap: 12px; color: #90a4ae;
}
.echo-gift-empty i { font-size: 48px; opacity: 0.3; }

/* 底部发送栏 */
.echo-gift-send-bar {
    margin-top: 14px; display: flex; justify-content: space-between;
    align-items: center; padding-top: 14px; border-top: 1px solid rgba(200,215,225,0.4); flex-shrink: 0;
}
.echo-gift-send-info { display: flex; flex-direction: column; gap: 2px; }
.echo-gift-send-text { font-size: 13px; color: #546e7a; font-weight: 600; }
.echo-gift-send-sub { font-size: 11px; color: #90a4ae; }
.echo-gift-btn-send {
    background: linear-gradient(135deg, #0d47a1, #1976d2); color: #fff; border: none;
    padding: 10px 28px; border-radius: 22px; font-size: 14px; font-weight: 600;
    box-shadow: 0 4px 12px rgba(13,71,161,0.3); cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; gap: 6px;
}
.echo-gift-btn-send:active { transform: scale(0.95); }
.echo-gift-btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* 赠送记录面板 */
.echo-gift-history {
    position: absolute; inset: 0; background: #eff3f6; z-index: 20;
    padding: 20px 18px; border-radius: 28px 28px 0 0;
    transform: translateX(100%); transition: 0.3s cubic-bezier(0.2,0.8,0.2,1);
    display: flex; flex-direction: column;
}
.echo-gift-history.show { transform: translateX(0); }
.echo-history-list { flex: 1; overflow-y: auto; margin-top: 12px; scrollbar-width: none; }
.echo-history-list::-webkit-scrollbar { display: none; }
.echo-history-item {
    display: flex; align-items: center; padding: 14px; background: rgba(255,255,255,0.7);
    border-radius: 14px; margin-bottom: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.03);
    border: 1px solid rgba(255,255,255,0.9);
}
.echo-history-item .h-emoji { font-size: 28px; width: 44px; text-align: center; margin-right: 12px; flex-shrink: 0; }
.echo-history-item .h-info { flex: 1; min-width: 0; }
.echo-history-item .h-name { font-size: 14px; font-weight: 600; color: #546e7a; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.echo-history-item .h-meta { font-size: 11px; color: #90a4ae; font-weight: 500; }
.echo-history-item .h-cost { font-size: 14px; color: #e57373; font-weight: 700; flex-shrink: 0; margin-left: 8px; }
.echo-history-empty { text-align: center; padding: 40px 20px; color: #b0bec5; font-size: 14px;
}

/* ========== 消息操作菜单（双击触发）========== */
.message-context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 160px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 6px 0;
    overflow: visible;  /* 改为 visible，让子菜单可以弹出 */
    animation: ctxMenuIn 0.18s ease-out;
}

/* 🌙 夜间模式适配 */
body.dark-mode .message-context-menu,
[data-theme="dark"] .message-context-menu {
    background: rgba(40, 40, 55, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* 子菜单容器 */
.context-menu-item.has-submenu {
    position: relative;
}

.context-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 140px;
    z-index: 100001;
    background: var(--glass-bg, rgba(255,255,255,0.95));
    border-radius: 12px;
    padding: 4px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(20px);
    transition: background 0.3s;
}

/* 🌙 夜间模式适配 */
body.dark-mode .context-submenu,
[data-theme="dark"] .context-submenu {
    background: rgba(35, 35, 50, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .submenu-item,
[data-theme="dark"] .submenu-item {
    color: #e8e6e3 !important;
}

body.dark-mode .submenu-item:hover,
body.dark-mode .submenu-item:active,
[data-theme="dark"] .submenu-item:hover,
[data-theme="dark"] .submenu-item:active {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* hover 或点击时显示子菜单 */
.context-menu-item.has-submenu:hover .context-submenu,
.context-menu-item.has-submenu.active .context-submenu,
.context-menu-item.has-submenu.expanded .context-submenu {
    display: block;
}

/* 如果子菜单超出右边界，改为向左弹出 */
.context-submenu.flip-left {
    left: auto;
    right: 100%;
}

@keyframes ctxMenuIn {
    from { opacity: 0; transform: scale(0.92) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    font-size: 14px;
    color: #37474f;
    cursor: pointer;
    transition: background 0.15s, color 0.3s;
    white-space: nowrap;
}

.context-menu-item:hover {
    background: rgba(100, 140, 200, 0.1);
}

.context-menu-item:active {
    background: rgba(100, 140, 200, 0.2);
}

.context-menu-item i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    color: #546e7a;
    transition: color 0.3s;
}

/* 🌙 夜间模式适配 */
body.dark-mode .context-menu-item,
[data-theme="dark"] .context-menu-item {
    color: #e8e6e3 !important;
}

body.dark-mode .context-menu-item:hover,
[data-theme="dark"] .context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .context-menu-item:active,
[data-theme="dark"] .context-menu-item:active {
    background: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .context-menu-item i,
[data-theme="dark"] .context-menu-item i {
    color: #b0bec5 !important;
}

.context-menu-item[data-action="delete"] {
    color: #e57373;
}

.context-menu-item[data-action="delete"] i {
    color: #e57373;
}

.context-menu-item.disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}

/* 翻译区块 */
.trans-box {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(120, 144, 156, 0.3);
}

.trans-box .trans-label {
    font-size: 10px;
    color: #90a4ae;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.trans-box .trans-text {
    font-size: 13px;
    color: #546e7a;
    line-height: 1.6;
    font-style: italic;
}

.trans-box .trans-loading {
    font-size: 12px;
    color: #90a4ae;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ========== 星汇详情页 Action Sheet 动画 ========== */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.action-sheet-wrap .action-sheet:active .as-item {
    background: rgba(161, 140, 209, 0.1);
}

/* ========== 星汇分享卡片（Echo 聊天内） ========== */
.echo-share-card {
    width: 240px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid rgba(161,140,209,0.15);
    box-shadow: 0 4px 20px rgba(161,140,209,0.12);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.echo-share-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(161,140,209,0.08);
}
.esc-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px 0;
    font-size: 11px;
    color: #a18cd1;
    font-weight: 600;
}
.esc-title {
    padding: 6px 14px 0;
    font-size: 14px;
    font-weight: 700;
    color: #4a3b3e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.esc-body {
    padding: 4px 14px 0;
    font-size: 12px;
    color: #887478;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.esc-stats {
    padding: 8px 14px 10px;
    font-size: 10px;
    color: #bbb;
    border-top: 1px solid rgba(0,0,0,0.04);
    margin-top: 8px;
}

/* ========== 帖子详情浮层（Echo 内） ========== */
.echo-post-overlay {
    position: absolute;
    inset: 0;
    z-index: 500;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}
.echo-post-overlay.active {
    transform: translateX(0);
}
.epo-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.epo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    color: #4a3b3e;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.epo-back {
    font-size: 24px;
    cursor: pointer;
    color: #a18cd1;
    transition: 0.15s;
}
.epo-back:active { opacity: 0.5; }
.epo-more {
    margin-left: auto;
    font-size: 20px;
    cursor: pointer;
    color: #887478;
}
.epo-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    -webkit-overflow-scrolling: touch;
}
.epo-author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.epo-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.epo-author-name {
    font-size: 15px;
    font-weight: 700;
    color: #4a3b3e;
}
.epo-time {
    font-size: 11px;
    color: #bbb;
    margin-top: 2px;
}
.epo-title {
    font-size: 18px;
    font-weight: 800;
    color: #4a3b3e;
    line-height: 1.5;
    margin-bottom: 12px;
}
.epo-title:empty { display: none; }
.epo-content {
    font-size: 14px;
    color: #594a4e;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
.epo-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    margin-top: 14px;
}
.epo-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
}
.epo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}
.epo-tag {
    font-size: 11px;
    color: #a18cd1;
    background: rgba(161,140,209,0.08);
    padding: 3px 10px;
    border-radius: 20px;
}
.epo-stats-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    color: #887478;
}
.epo-stats-row i {
    margin-right: 4px;
    color: #a18cd1;
}

/* ========== 星汇帖子列表 强制样式 ========== */
.post-card {
    padding: 14px 16px 12px !important;
    margin-bottom: 10px !important;
    border-radius: 16px !important;
}
.post-card h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.post-card p {
    font-size: 13px !important;
    line-height: 1.7 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    white-space: pre-wrap !important;
}

/* ========== 多选模式样式 ========== */
.msg-row.selected {
    background: rgba(161,140,209,0.08) !important;
    border-radius: 12px;
}

/* ========== 🎵 音乐卡片（一起听）========== */
.music-card {
    width: 250px;
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.music-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.music-card.playing {
    border-color: #d67a89;
    background: linear-gradient(to right, #fff, #fffbfc);
}

/* 封面容器 */
.mc-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    flex-shrink: 0;
    background: #eee;
}

.mc-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play 图标遮罩 */
.mc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    transition: opacity 0.3s;
}

/* 播放状态 - 封面变圆盘 */
.music-card.playing .mc-cover {
    border-radius: 50%;
    box-shadow: 0 0 0 2px #d67a89;
    animation: spin 4s linear infinite;
}

.music-card.playing .mc-cover img {
    border-radius: 50%;
}

.music-card.playing .mc-overlay {
    opacity: 0;
    pointer-events: none;
}

/* 旋转动画 */
@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* 文本信息区 */
.mc-info {
    flex: 1;
    overflow: hidden;
}

.mc-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.music-card.playing .mc-title {
    color: #d67a89;
}

.mc-sub {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    height: 16px;
}

/* 波纹动画容器 */
.wave-box {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 10px;
    margin-left: 6px;
}

.bar {
    width: 2px;
    background: #d67a89;
    border-radius: 1px;
    animation: wave 0.8s ease-in-out infinite;
}

.bar:nth-child(1) { animation-delay: 0s; height: 3px; }
.bar:nth-child(2) { animation-delay: 0.1s; height: 5px; }
.bar:nth-child(3) { animation-delay: 0.2s; height: 3px; }

@keyframes wave {
    0%, 100% {
        height: 3px;
        opacity: 0.6;
    }
    50% {
        height: 10px;
        opacity: 1;
    }
}

/* ========== 🎵 选歌弹窗 ========== */
.music-select-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.music-select-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.music-select-modal-box {
    width: 340px;
    max-width: 90vw;
    max-height: 70vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.music-select-modal-overlay.active .music-select-modal-box {
    transform: scale(1) translateY(0);
}

.msm-header {
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.msm-header span {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.msm-header i {
    font-size: 22px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.msm-header i:hover {
    color: #333;
}

.msm-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.song-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f8f8f8;
}

.song-select-item:hover {
    background: #f9f9f9;
}

.song-select-item:active {
    background: #f0f0f0;
}

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

.song-select-item img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
}

.ss-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.ss-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-artist {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-select-item > i {
    font-size: 20px;
    color: #d67a89;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.song-select-item:hover > i {
    opacity: 1;
}

/* 滚动条美化 */
.msm-list::-webkit-scrollbar {
    width: 6px;
}

.msm-list::-webkit-scrollbar-track {
    background: transparent;
}

.msm-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.msm-list::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* =========================================
   共听音乐面板 (Music Co-Listening Panel)
   ========================================= */

/* 面板遮罩层 */
.music-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    z-index: 150;
    display: none !important; /* 🔧 默认隐藏 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.music-panel-overlay.active {
    display: block !important; /* 🔧 激活时显示 */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 🔧 确保关闭的面板不阻挡点击 */
.music-panel:not(.active) {
    pointer-events: none !important;
}

/* 面板主体 */
.music-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85%;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 40px 40px 0 0;
    box-shadow: 0 -10px 40px rgba(161, 140, 209, 0.15);
    z-index: 200;
    display: none !important; /* 🔧 默认隐藏 */
    flex-direction: column;
    padding: 15px 25px;
}

.music-panel.active {
    display: flex !important; /* 🔧 激活时显示 */
    transform: translateY(0);
}

/* 拖拽手柄 */
.panel-dragger {
    width: 40px;
    height: 5px;
    background: rgba(161, 140, 209, 0.3);
    border-radius: 10px;
    margin: 0 auto 15px;
    flex-shrink: 0;
}

/* 头部区域 */
.co-listening-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-shrink: 0;
}

.co-title {
    font-size: 15px;
    font-weight: 800;
    color: #a18cd1;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 头像组 */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.avatar-group img:first-child {
    margin-left: 0;
}

.avatar-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fdfbfd;
    border: 2px solid #fff;
    margin-left: -10px;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #a18cd1;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 退出共听按钮 */
.btn-exit {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 107, 129, 0.12);
    border: 1px solid rgba(255, 107, 129, 0.2);
    color: #ff5277;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(255, 107, 129, 0.1);
    transition: all 0.2s;
}

.btn-exit:active {
    transform: scale(0.92);
    box-shadow: none;
}

/* 播放器核心区域 */
.panel-player {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-shrink: 0;
}

.player-cover {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(161, 140, 209, 0.3);
    flex-shrink: 0;
    position: relative;
    background: #eee;
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: spin 8s linear infinite;
    border-radius: 50%;
    transform: scale(1.1);
}

.player-cover.paused img {
    animation-play-state: paused !important;
}

.player-info {
    flex: 1;
    overflow: hidden;
}

.player-song {
    font-size: 20px;
    font-weight: 800;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 13px;
    color: #888;
}

/* 进度条 */
.progress-container {
    width: 100%;
    margin-bottom: 25px;
    flex-shrink: 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(161, 140, 209, 0.15);
    border-radius: 10px;
    position: relative;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #a18cd1, #fbc2eb);
    border-radius: 10px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(251, 194, 235, 0.8);
}

/* 控制按钮 */
.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 10px;
    flex-shrink: 0;
}

.ctrl-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #a18cd1;
    font-size: 22px;
    border: none;
    box-shadow: 0 4px 12px rgba(161, 140, 209, 0.15);
    transition: all 0.2s;
}

.ctrl-btn:active {
    transform: scale(0.9);
}

.ctrl-btn.play {
    width: 60px;
    height: 60px;
    font-size: 30px;
    color: white;
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 8px 20px rgba(251, 194, 235, 0.5);
}

/* 播放列表头部 */
.playlist-header {
    font-size: 16px;
    font-weight: 800;
    color: #333;
    margin-bottom: 15px;
    flex-shrink: 0;
}

/* 播放列表 */
.playlist {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
}

.playlist::-webkit-scrollbar {
    display: none;
}

/* 播放列表项 */
.playlist-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.6);
}

.playlist-item.active {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(251, 194, 235, 0.4);
    box-shadow: 0 4px 15px rgba(161, 140, 209, 0.08);
}

.pl-cover {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}

.pl-info {
    flex: 1;
    overflow: hidden;
}

.pl-song {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-artist {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item.active .pl-song {
    color: #a18cd1;
}

/* 音乐卡片播放/暂停/退出状态增强 */
.music-card.playing.paused img {
    animation-play-state: paused !important;
}

.music-card.playing.paused .bar {
    animation-play-state: paused !important;
}

.playlist-item.paused .wave-box .bar {
    animation-play-state: paused !important;
}

/* 退出状态 (Exited) */
.music-card.exited {
    background: rgba(245, 245, 245, 0.7);
    border-color: rgba(0, 0, 0, 0.05);
    cursor: default;
    opacity: 0.8;
    box-shadow: none;
}

.music-card.exited:active {
    transform: none;
}

.music-card.exited .mc-cover {
    border-radius: 12px;
    background: #ddd;
    box-shadow: none;
    padding: 0;
}

.music-card.exited .mc-cover img {
    border-radius: 12px;
    animation: none;
    filter: grayscale(50%) opacity(0.8);
}

.music-card.exited .mc-title {
    color: #888;
    text-decoration: line-through;
    text-decoration-color: rgba(0, 0, 0, 0.2);
}

/* ==========================================
   🎲 骰子组件样式 (Cyber Dice)
========================================== */
.cyber-dice {
    width: 68px;
    height: 68px;
    background: #ffffff;
    border-radius: 18px;
    border: 1.5px solid rgba(251, 194, 235, 0.6);
    box-shadow: 0 6px 16px rgba(251, 194, 235, 0.25), inset 0 -4px 8px rgba(0,0,0,0.03);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    place-items: center;
    padding: 10px;
    gap: 3px;
    transform-origin: center center;
}

.cyber-dice i {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
    box-shadow: 0 2px 5px rgba(251, 194, 235, 0.5);
    opacity: 0;
    transition: opacity 0.05s;
}

/* 点数排布逻辑 */
.cyber-dice[data-face="1"] i:nth-child(5) {
    opacity: 1;
    transform: scale(1.3);
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    box-shadow: 0 2px 6px rgba(255, 154, 158, 0.5);
}

.cyber-dice[data-face="2"] i:nth-child(3),
.cyber-dice[data-face="2"] i:nth-child(7) {
    opacity: 1;
}

.cyber-dice[data-face="3"] i:nth-child(3),
.cyber-dice[data-face="3"] i:nth-child(5),
.cyber-dice[data-face="3"] i:nth-child(7) {
    opacity: 1;
}

.cyber-dice[data-face="4"] i:nth-child(1),
.cyber-dice[data-face="4"] i:nth-child(3),
.cyber-dice[data-face="4"] i:nth-child(7),
.cyber-dice[data-face="4"] i:nth-child(9) {
    opacity: 1;
}

.cyber-dice[data-face="5"] i:nth-child(1),
.cyber-dice[data-face="5"] i:nth-child(3),
.cyber-dice[data-face="5"] i:nth-child(5),
.cyber-dice[data-face="5"] i:nth-child(7),
.cyber-dice[data-face="5"] i:nth-child(9) {
    opacity: 1;
}

.cyber-dice[data-face="6"] i:nth-child(1),
.cyber-dice[data-face="6"] i:nth-child(4),
.cyber-dice[data-face="6"] i:nth-child(7),
.cyber-dice[data-face="6"] i:nth-child(3),
.cyber-dice[data-face="6"] i:nth-child(6),
.cyber-dice[data-face="6"] i:nth-child(9) {
    opacity: 1;
}

.cyber-dice.rolling {
    animation: tossAnim 0.5s infinite ease-in-out;
    box-shadow: 0 20px 25px rgba(251, 194, 235, 0.4), inset 0 -4px 8px rgba(0,0,0,0.03);
}

@keyframes tossAnim {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-25px) rotate(90deg) scale(1.05); }
    50% { transform: translateY(-40px) rotate(180deg) scale(1.1); }
    75% { transform: translateY(-20px) rotate(270deg) scale(1.05); }
    100% { transform: translateY(0) rotate(360deg) scale(1); }
}

/* ==========================================
   💰 金钱输入弹窗遮罩
========================================== */
.mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(93, 84, 104, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.mask.on {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================
   🧧 红包/转账组件样式（新版 - 玫瑰茶红 & 香槟金）
========================================== */
/* 全局变量 */
:root {
    --rose-main: #d65c6f;
    --rose-light: #e88292;
    --rose-dark: #b84355;
    --rose-opened: rgba(214, 92, 111, 0.15);
    --gold-light: #f5e4c3;
    --gold-main: #e6c88e;
    --gold-opened: rgba(230, 200, 142, 0.25);
    --text-dark: #5c4347;
    --text-sub: #a88d92;
    --shadow-rose: 0 8px 24px rgba(214, 92, 111, 0.25);
    --shadow-gold: 0 8px 24px rgba(230, 200, 142, 0.4);
}

/* 红包气泡基础通用样式 */
.hb-bubble {
    width: 245px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hb-content {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.hb-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-grow: 1;
    min-width: 0;
}

.hb-text-main {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hb-text-sub {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

.hb-bottom {
    padding: 7px 16px;
    font-size: 11px;
    z-index: 2;
    position: relative;
    letter-spacing: 0.5px;
}

/* 微光扫过特效 */
.hb-bubble::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    animation: diamondGlow 3.5s infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes diamondGlow {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* 1. 普通红包（纯净玫瑰） */
.hb-bubble.normal {
    background: linear-gradient(135deg, var(--rose-light) 0%, var(--rose-main) 100%);
    box-shadow: 0 6px 20px rgba(214, 92, 111, 0.3), inset 0 1px 3px rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.2);
}

.hb-bubble.normal .hb-icon {
    width: 36px;
    height: 42px;
    position: relative;
    border-radius: 6px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fdf2d8 0%, #e6c88e 100%);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.8), 0 4px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-bubble.normal .hb-icon::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%23b84355" xmlns="http://www.w3.org/2000/svg"><path d="M12 12C12 12 8 8 5 9C2 10 3 15 5 16C7 17 12 12 12 12ZM12 12C12 12 16 8 19 9C22 10 21 15 19 16C17 17 12 12 12 12Z"/><circle cx="12" cy="12" r="2" fill="%23d65c6f"/></svg>') no-repeat center;
}

.hb-bubble.normal .hb-text {
    color: #fff;
    text-shadow: 0 1px 2px rgba(184, 67, 85, 0.4);
}

.hb-bubble.normal .hb-bottom {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.95);
    border-top: 1px solid rgba(255,255,255,0.15);
}

/* 普通红包已领取状态 */
.hb-bubble.normal.opened {
    background: var(--rose-opened);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none;
    border: 1px solid rgba(214, 92, 111, 0.2);
}

.hb-bubble.normal.opened::after {
    display: none;
}

.hb-bubble.normal.opened .hb-text {
    color: var(--rose-dark);
    text-shadow: none;
}

.hb-bubble.normal.opened .hb-text-sub {
    color: #c49ea5;
}

.hb-bubble.normal.opened .hb-icon {
    background: rgba(230, 200, 142, 0.3);
    box-shadow: none;
    opacity: 0.7;
}

.hb-bubble.normal.opened .hb-bottom {
    background: rgba(214, 92, 111, 0.05);
    color: #c49ea5;
    border-top: 1px solid rgba(214, 92, 111, 0.1);
}

/* 2. 拼手气红包（玫瑰粉到香槟金渐变） */
.hb-bubble.lucky {
    background: linear-gradient(135deg, #f5a9b8 0%, #d65c6f 40%, #e6c88e 100%);
    box-shadow: 0 6px 20px rgba(230, 200, 142, 0.5), inset 0 1px 3px rgba(255,255,255,0.6);
    border: 1px solid rgba(250, 235, 210, 0.6);
}

/* 巨大磨砂水印 */
.hb-bubble.lucky::before {
    content: '拼';
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 64px;
    color: rgba(255, 255, 255, 0.15);
    font-family: "Songti SC", "STSong", serif;
    font-weight: 900;
    transform: rotate(-15deg);
    z-index: 1;
    pointer-events: none;
}

.hb-bubble.lucky .hb-icon {
    width: 42px;
    height: 42px;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7e6 0%, #f5e4c3 100%);
    box-shadow: inset 0 2px 5px #fff, 0 4px 10px rgba(214, 92, 111, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #fff;
}

.hb-bubble.lucky .hb-icon::before {
    content: '拼';
    color: var(--rose-main);
    font-size: 20px;
    font-weight: bold;
    font-family: "Songti SC", serif;
    background: none;
}

.hb-bubble.lucky .hb-text {
    color: #fff;
    text-shadow: 0 1px 3px rgba(214, 92, 111, 0.6);
}

.hb-bubble.lucky .hb-bottom {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border-top: 1px solid rgba(255,255,255,0.3);
    text-shadow: 0 1px 2px rgba(214, 92, 111, 0.4);
}

/* 拼手气红包已领取状态 */
.hb-bubble.lucky.opened {
    background: var(--gold-opened);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none;
    border: 1px solid rgba(230, 200, 142, 0.4);
}

.hb-bubble.lucky.opened::after {
    display: none;
}

.hb-bubble.lucky.opened::before {
    color: rgba(214, 92, 111, 0.06);
}

.hb-bubble.lucky.opened .hb-text {
    color: #a37936;
    text-shadow: none;
}

.hb-bubble.lucky.opened .hb-text-sub {
    color: #c2a172;
}

.hb-bubble.lucky.opened .hb-icon {
    background: rgba(255,255,255,0.5);
    border-color: rgba(230, 200, 142, 0.5);
    box-shadow: none;
    opacity: 0.8;
}

.hb-bubble.lucky.opened .hb-icon::before {
    color: #c2a172;
}

.hb-bubble.lucky.opened .hb-bottom {
    background: rgba(230, 200, 142, 0.15);
    color: #b8853b;
    border-top: 1px solid rgba(230, 200, 142, 0.3);
}

/* 黑金转账卡片 */
.gold-card {
    width: 240px;
    height: 120px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    cursor: pointer;
}

.msg-row:not(.me) .gold-card {
    background: #fff;
    border: 1px solid #D4AF37;
}

.msg-row.me .gold-card {
    background: linear-gradient(135deg, #D4AF37, #AA8526);
    color: #fff;
}

.card-top {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
}

.card-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.msg-row:not(.me) .card-icon {
    background: #FFF9E6;
    color: #D4AF67;
}

.msg-row.me .card-icon {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
}

.card-mid {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
}

.msg-row:not(.me) .card-mid {
    color: #D4AF37;
}

.card-btm {
    height: 28px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
}

.msg-row:not(.me) .card-btm {
    background: #FFF9E6;
    color: #D4AF37;
}

.msg-row.me .card-btm {
    background: rgba(0,0,0,0.1);
    color: rgba(255,255,255,0.8);
}

/* 已收款状态 */
.gold-card.opened {
    opacity: 0.7;
    filter: grayscale(0.3);
}

/* ==========================================
   🎬 视频/阅读组件样式
========================================== */
/* 播放器全屏弹窗 */
.player-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.player-modal.active {
    transform: translateY(0);
}

.pm-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    color: #fff;
    z-index: 10;
}

.pm-minimize {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pm-video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.pm-video-container video {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 弹幕轨道 */
.danmaku-track {
    position: absolute;
    top: 20%;
    left: 0;
    width: 100%;
    height: 60%;
    pointer-events: none;
    overflow: hidden;
}

.dm-msg {
    position: absolute;
    white-space: nowrap;
    color: #fff;
    font-size: 14px;
    text-shadow: 1px 1px 2px #000;
    padding: 4px 10px;
    border-radius: 15px;
    background: rgba(0,0,0,0.3);
}

.pm-footer {
    height: 60px;
    background: #111;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 12px;
}

.pm-input {
    flex: 1;
    height: 36px;
    border-radius: 18px;
    border: none;
    background: #333;
    padding: 0 15px;
    color: #fff;
    outline: none;
}

/* 阅读器层 */
.reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f6f4ec;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.reader-overlay.active {
    transform: translateY(0);
}

.reader-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 10;
    transition: transform 0.3s;
}

.reader-header.hidden {
    transform: translateY(-100%);
}

.reader-content {
    flex: 1;
    overflow-y: auto;
    padding: 60px 20px 70px 20px;
    font-size: 18px;
    line-height: 1.8;
    color: #222;
    text-align: justify;
    position: relative;
}

.reader-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 56px;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
    z-index: 10;
    transition: transform 0.3s;
}

.reader-footer.hidden {
    transform: translateY(100%);
}

.rf-input {
    flex: 1;
    height: 36px;
    background: #f2f2f2;
    border: none;
    border-radius: 18px;
    padding: 0 15px;
}

/* 评论气泡 (自动消失) */
.comment-bubble {
    position: absolute;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
    animation: slideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.comment-bubble.fading-out {
    animation: fadeOut 0.5s forwards;
    pointer-events: none;
}

.comment-bubble.mine {
    left: 10px;
    background: #95ec69;
    border: 1px solid #7bc856;
}

.comment-bubble.other {
    right: 10px;
    background: #fff;
    border: 1px solid #ddd;
}

.cb-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ==========================================
   📍 定位组件样式
========================================== */
/* 地图气泡卡片 */
.loc-card-bubble {
    width: 260px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.9);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.msg-row.other .loc-card-bubble {
    border-bottom-left-radius: 6px;
}

.msg-row.me .loc-card-bubble {
    border-bottom-right-radius: 6px;
    border-color: rgba(142, 197, 252, 0.5);
    box-shadow: 0 6px 20px rgba(142, 197, 252, 0.2);
}

.loc-card-bubble:active {
    transform: scale(0.97);
}

.loc-card-map {
    width: 100%;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aesthetic-map-bg {
    background-color: #f4f7fb;
    background-image: url("data:image/svg+xml,%3Csvg width='800' height='600' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='%23f4f7fb'/%3E%3Cpath d='M-50,150 Q150,200 250,100 T450,250 T850,150 L850,-50 L-50,-50 Z' fill='%23e1f0ff'/%3E%3Cpath d='M600,650 Q550,500 700,450 T850,550 L850,650 Z' fill='%23e1f0ff'/%3E%3Cpath d='M100,450 C150,350 300,380 250,480 C200,550 50,500 100,450 Z' fill='%23eaf5e1'/%3E%3Cpath d='M650,200 C750,150 800,250 700,300 C600,350 550,250 650,200 Z' fill='%23eaf5e1'/%3E%3Cpath d='M-50,300 C200,350 400,200 850,350 M250,-50 L350,650 M600,-50 L500,650' fill='none' stroke='%23ffffff' stroke-width='24' stroke-linecap='round'/%3E%3Cpath d='M-50,450 L350,350 M350,350 L850,450 M100,-50 L150,300 M750,-50 L650,350 M150,500 L850,200 M-50,150 L250,100' fill='none' stroke='%23ffffff' stroke-width='10' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}

.loc-card-map::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(224, 195, 252, 0.1));
}

.loc-card-info {
    padding: 12px 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 2;
}

.loc-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.loc-title {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #546e7a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.loc-distance {
    font-size: 10px;
    color: #1976d2;
    background: rgba(142, 197, 252, 0.2);
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    font-weight: 700;
    border: 1px solid rgba(142, 197, 252, 0.4);
    box-shadow: 0 2px 4px rgba(142, 197, 252, 0.1);
}

.loc-desc {
    font-size: 11px;
    color: #90a4ae;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 定位针 */
.pin-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.poi-tooltip {
    position: absolute;
    top: -46px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #0d47a1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    transform-origin: bottom center;
    opacity: 0;
    transform: scale(0.5) translateY(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 4px;
}

.poi-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff;
}

.poi-tooltip.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.cute-map-pin {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 2px 2px 10px rgba(255, 154, 158, 0.5);
    position: relative;
    z-index: 2;
    animation: pin-float 2s ease-in-out infinite;
}

.cute-map-pin::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.pin-shadow {
    width: 24px;
    height: 6px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    margin-top: 14px;
    animation: pin-shadow 2s ease-in-out infinite;
}

@keyframes pin-float {
    0%, 100% {
        transform: translateY(0) rotate(-45deg);
    }
    50% {
        transform: translateY(-8px) rotate(-45deg);
    }
}

@keyframes pin-shadow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(0.6);
        opacity: 0.3;
    }
}

/* 定位编辑面板 - 修复：在手机框架内 */
.loc-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #eff3f6;
    z-index: 200;
    transform: translateY(100%);
    transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    pointer-events: none; /* 🔧 未打开时不接收点击事件 */
}

.loc-panel.open {
    transform: translateY(0);
    pointer-events: auto; /* 🔧 打开时恢复点击事件 */
}

.loc-header {
    padding: 20px 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.loc-back {
    font-size: 24px;
    color: #546e7a;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loc-header-title {
    font-size: 16px;
    font-weight: 700;
    color: #546e7a;
}

.btn-send-loc {
    background: linear-gradient(135deg, #e0c3fc, #8ec5fc);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(142, 197, 252, 0.4);
    transition: 0.2s;
}

.btn-send-loc:active {
    transform: scale(0.95);
}

.large-map {
    height: 35vh;
    box-shadow: inset 0 -15px 20px rgba(255,255,255,0.9);
}

.large-pin {
    width: 44px;
    height: 44px;
}

.large-pin::after {
    width: 14px;
    height: 14px;
}

.loc-form-view {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.9));
    z-index: 2;
}

.form-title {
    font-size: 13px;
    font-weight: 600;
    color: #546e7a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-input-box {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(142, 197, 252, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.glass-input {
    width: 100%;
    border: none;
    background: rgba(245, 247, 250, 0.6);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #546e7a;
    transition: 0.2s;
    border: 1px solid transparent;
}

.glass-input:focus {
    background: #fff;
    border-color: #8ec5fc;
    box-shadow: 0 2px 8px rgba(142, 197, 252, 0.15);
    outline: none;
}

.glass-input::placeholder {
    color: #b0bec5;
    font-weight: 400;
    font-size: 13px;
}

/* 🔧 定位面板输入框样式覆盖（修复被 index-styles.css 的 !important 覆盖的问题） */
.loc-panel .glass-input {
    background: rgba(245, 247, 250, 0.6) !important;
    border: 1px solid transparent !important;
    color: #546e7a !important;
}

.loc-panel .glass-input:focus {
    background: #fff !important;
    border-color: #8ec5fc !important;
}

.loc-panel .glass-input::placeholder {
    color: #b0bec5 !important;
    font-weight: 400;
    font-size: 13px;
}

/* 🔧 定位面板 - 快捷锚点保存按钮 */
.btn-save-tag {
    width: 100%;
    padding: 14px;
    background: rgba(142, 197, 252, 0.15);
    color: #0d47a1;
    border: 1px dashed rgba(142, 197, 252, 0.5);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-save-tag:active {
    background: rgba(142, 197, 252, 0.25);
    transform: scale(0.98);
}

/* 🔧 定位面板 - 标签管理区头部 */
.tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.btn-manage {
    font-size: 12px;
    color: #8ec5fc;
    background: #fff;
    padding: 6px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    border: 1px solid rgba(142, 197, 252, 0.3);
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.btn-manage:active {
    transform: scale(0.95);
}

/* 🔧 定位面板 - 快捷标签容器 */
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 30px;
}

.q-tag-wrap {
    position: relative;
    display: inline-block;
}

.q-tag {
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #546e7a;
    border: 1px solid rgba(200, 215, 225, 0.6);
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 6px;
}

.q-tag:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #e0c3fc, #8ec5fc);
    color: #fff;
    border-color: transparent;
}

.tag-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e57373;
    color: #fff;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(229, 115, 115, 0.4);
    border: 2px solid #fff;
    z-index: 5;
}

.manage-mode .tag-delete-btn {
    display: flex;
    animation: popIn 0.2s ease-out;
}

.manage-mode .q-tag {
    pointer-events: none;
    opacity: 0.8;
    animation: shake 0.3s infinite alternate;
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0% { transform: rotate(-1deg); }
    100% { transform: rotate(1deg); }
}

/* ==================== 🖼️ 发送图片面板样式 ==================== */
/* 图片气泡 */
.img-card-bubble {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    max-width: 200px;
    max-height: 200px;
    overflow: hidden;
}
.img-card-bubble:active { transform: scale(0.97); }
.chat-img {
    width: 100%;
    max-height: 188px; /* 200px - 12px padding */
    border-radius: 14px;
    display: block;
    object-fit: cover; /* 保持比例裁剪 */
}

/* 发送图片专属面板 - 3/4屏幕高度 */
.image-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 75vh; /* 3/4屏幕高度 */
    background: linear-gradient(to bottom, #eff3f6, #fdfbfb);
    z-index: 90; /* 降低z-index，确保在聊天header之下 */
    transform: translateY(100%);
    transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: none; /* 默认隐藏 */
    flex-direction: column;
    border-radius: 24px 24px 0 0; /* 顶部圆角 */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
.image-panel.open { 
    display: flex; /* 激活时显示 */
    transform: translateY(0); 
}

.image-panel .panel-header {
    padding: 20px 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    z-index: 10;
}
.image-panel .btn-back {
    font-size: 24px;
    color: #546e7a;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-panel .btn-send-image {
    background: linear-gradient(135deg, #e0c3fc, #8ec5fc);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(142, 197, 252, 0.4);
}
.image-panel .panel-body {
    flex: 1;
    padding: 24px 20px 40px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}

/* 隐藏滚动条但保持功能 */
.image-panel .panel-body::-webkit-scrollbar {
    width: 4px;
}

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

.image-panel .panel-body::-webkit-scrollbar-thumb {
    background: rgba(142, 197, 252, 0.3);
    border-radius: 2px;
}

.image-panel .panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 197, 252, 0.5);
}

/* 预览区与表单 */
.image-panel .preview-area {
    width: 100%;
    height: 200px; /* 固定高度，更适合3/4屏幕 */
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed rgba(142, 197, 252, 0.6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* 防止被压缩 */
}
.image-panel .preview-area img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    border-radius: 16px;
    position: absolute;
    top: 0;
    left: 0;
}

/* 强力显示规则 - 只要有src就显示 */
.image-panel .preview-area img[src] {
    display: block !important;
}

/* 但是空src要隐藏 */
.image-panel .preview-area img[src=""] {
    display: none !important;
}
.image-panel .preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #90a4ae;
    gap: 8px;
}
.image-panel .method-tabs {
    display: flex;
    gap: 8px;
    background: rgba(200, 215, 225, 0.25);
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 20px;
}
.image-panel .m-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #90a4ae;
    cursor: pointer;
    border: none;
    background: transparent;
}
.image-panel .m-tab.active {
    background: #fff;
    color: #546e7a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.image-panel .tab-content {
    display: none;
    animation: imgPanelFadeIn 0.3s ease;
}
.image-panel .tab-content.show { display: block; }
@keyframes imgPanelFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.image-panel .glass-textarea {
    width: 100%;
    border: none;
    background: rgba(245, 247, 250, 0.6);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    color: #546e7a;
    resize: none;
}
.image-panel .color-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
}
.image-panel .color-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.image-panel .color-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.image-panel .color-btn.active {
    transform: scale(1.1);
    border-color: #0d47a1;
    border-width: 4px;
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.4);
}
.image-panel .color-btn.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 表单输入框样式 */
.image-panel .glass-input-box {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(142, 197, 252, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-panel .glass-input {
    width: 100%;
    border: none;
    background: rgba(245, 247, 250, 0.6);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #546e7a;
}

.image-panel .glass-input::placeholder {
    color: #90a4ae;
    font-weight: 400;
}

/* 预览占位符图标样式 */
.image-panel .preview-placeholder i {
    font-size: 36px;
    color: #8ec5fc;
    opacity: 0.8;
}

/* 高级控制面板 */
.image-panel .advanced-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
}

.image-panel .control-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.image-panel .control-label {
    font-size: 12px;
    color: #546e7a;
    font-weight: 600;
    min-width: 60px;
}

.image-panel .slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-panel .slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e0c3fc, #8ec5fc);
    outline: none;
}

/* 色相滑块 - 彩虹渐变 */
.image-panel .hue-slider {
    background: linear-gradient(to right, 
        hsl(0, 100%, 70%),
        hsl(30, 100%, 70%),
        hsl(60, 100%, 70%),
        hsl(90, 100%, 70%),
        hsl(120, 100%, 70%),
        hsl(150, 100%, 70%),
        hsl(180, 100%, 70%),
        hsl(210, 100%, 70%),
        hsl(240, 100%, 70%),
        hsl(270, 100%, 70%),
        hsl(300, 100%, 70%),
        hsl(330, 100%, 70%),
        hsl(360, 100%, 70%)
    );
}

.image-panel .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #8ec5fc;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.image-panel .slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #8ec5fc;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.image-panel .slider-value {
    font-size: 12px;
    color: #546e7a;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

.image-panel .align-buttons {
    display: flex;
    gap: 6px;
}

.image-panel .align-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid rgba(142, 197, 252, 0.3);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: #90a4ae;
}

.image-panel .align-btn:hover {
    border-color: #8ec5fc;
    background: rgba(255, 255, 255, 0.9);
}

.image-panel .align-btn.active {
    border-color: #8ec5fc;
    background: #8ec5fc;
    color: white;
}

/* 自定义颜色选择器 */
.image-panel .custom-color-picker {
    display: flex;
    gap: 8px;
    align-items: center;
}

.image-panel .color-input-wrapper {
    flex: 1;
    display: flex;
    gap: 8px;
}

.image-panel .color-input {
    flex: 1;
    height: 40px;
    border: 2px solid rgba(142, 197, 252, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.image-panel .color-input:hover {
    border-color: #8ec5fc;
    transform: scale(1.05);
}

.image-panel .apply-custom-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #e0c3fc, #8ec5fc);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.image-panel .apply-custom-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(142, 197, 252, 0.4);
}

/* ========== 🎬 剧情卡片居中样式 ========== */
/* 确保剧情卡片在所有容器中都能居中显示 */

/* 剧情卡片本身的样式 */
.scenario-card {
    display: block !important;
    margin: 10px auto !important;
    max-width: 90% !important;
}

/* 确保包含剧情卡片的容器允许居中 */
.msg-content .scenario-card,
.voice-text-caption .scenario-card,
.speech-bubble .scenario-card {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 语音消息组中的文字说明容器 */
.voice-message-group .voice-text-caption {
    width: 100%;
    max-width: 100%;
    display: block;
}

/* 确保父容器不限制剧情卡片的宽度 */
.msg-content:has(.scenario-card),
.voice-text-caption:has(.scenario-card) {
    max-width: 100% !important;
    width: 100% !important;
}

/* 兼容性：如果浏览器不支持 :has()，使用通用规则 */
@supports not (selector(:has(*))) {
    .msg-content,
    .voice-text-caption {
        max-width: 100%;
        width: 100%;
    }
}

/* ==================== 红包和转账卡片容器 ==================== */
.money-card {
    display: block !important;
    margin: 10px auto !important;
}

/* 转账金卡（保留旧版兼容性） */
.gold-card {
    width: 260px;
    height: 140px;
    border-radius: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    background: linear-gradient(135deg, #D4AF37 0%, #AA8526 100%);
    color: #fff;
    transition: all 0.3s ease;
    user-select: none;
}

.gold-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.gold-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(30deg);
    pointer-events: none;
}

.gold-card.opened {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #D4AF37;
    cursor: default;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gold-card.opened .card-top,
.gold-card.opened .card-mid,
.gold-card.opened .card-btm {
    color: #999;
}

.gold-card.opened .card-amt {
    color: #D4AF37;
}

/* 红包/转账弹窗遮罩 */
.money-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.money-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 红包结果弹窗 */
.money-result-modal {
    background: #fff;
    width: 85%;
    max-width: 320px;
    border-radius: 30px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.money-modal-overlay.show .money-result-modal {
    transform: scale(1) translateY(0);
}

.money-modal-avatar {
    width: 60px;
    height: 60px;
    background: #fbc2eb;
    border-radius: 50%;
    border: 3px solid #fff;
    margin: 0 auto 15px;
}

.money-sender-info {
    color: #999;
    font-size: 14px;
    margin-bottom: 5px;
}

.money-wish-text {
    color: #5D5468;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 16px;
}

.money-big-amount {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

.money-close-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 50%;
    color: #999;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: #f5f5f5;
    margin: 0 auto;
    transition: all 0.2s;
}

.money-close-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* ================= 群聊红包拆包弹窗 ================= */
.packet-modal-mask {
    position: absolute; /* 相对于 phone-frame 定位 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 247, 248, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 500;
    display: none !important; /* 🔧 默认隐藏 */
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.packet-modal-mask.show {
    display: flex !important; /* 🔧 显示时使用 flex */
    opacity: 1;
    pointer-events: auto;
}

.red-envelope-card {
    width: 300px;
    height: 430px;
    background: linear-gradient(180deg, #d65c6f 0%, #b84355 100%);
    border-radius: 26px;
    position: relative;
    overflow: hidden;
    text-align: center;
    transform: scale(0.8) translateY(40px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.2);
    box-shadow: 0 30px 60px rgba(184, 67, 85, 0.3), inset 0 2px 10px rgba(255,255,255,0.3);
    border: 1px solid #e88292;
}

.packet-modal-mask.show .red-envelope-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.envelope-curve {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 135px;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
    border-bottom-left-radius: 50% 30px;
    border-bottom-right-radius: 50% 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 2;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.card-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 55px;
    color: #fff;
}

.card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    border: 2px solid #f5e4c3;
    margin-bottom: 12px;
    background: #eee;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.card-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-type-hint {
    font-size: 12px;
    color: #fadce0;
    margin-top: 4px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pin-icon-small {
    background: #f5e4c3;
    color: #b84355;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
}

.card-wish {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 0 24px;
    color: #f5e4c3;
    line-height: 1.4;
}

.open-btn {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #fff7e6 0%, #e6c88e 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Songti SC", "STSong", serif;
    font-size: 34px;
    font-weight: 500;
    color: #b84355;
    position: absolute;
    top: 250px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    border: 2px solid #fff;
    z-index: 10;
    box-shadow: 0 15px 30px rgba(184, 67, 85, 0.4), inset 0 2px 6px #fff;
    transition: transform 0.2s;
}

.open-btn::before {
    content: '';
    position: absolute;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 1px dashed rgba(184, 67, 85, 0.4);
    animation: rotateDash 10s linear infinite;
}

@keyframes rotateDash {
    to { transform: rotate(360deg); }
}

.open-btn:hover {
    transform: translateX(-50%) scale(1.05);
}

.open-btn.spinning {
    animation: coinSpin3D 1s infinite cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    color: transparent;
    border-color: transparent;
}

.open-btn.spinning::before {
    display: none;
}

@keyframes coinSpin3D {
    0% { transform: translateX(-50%) rotateY(0deg); }
    100% { transform: translateX(-50%) rotateY(360deg); }
}

@keyframes coinSpin {
    0% {
        transform: translateX(-50%) rotateY(0deg);
    }
    100% {
        transform: translateX(-50%) rotateY(360deg);
    }
}

/* ================= 红包/转账输入弹窗动态皮肤 ================= */

/* 基础弹窗结构 (保持底部抽屉) */
.screen-input {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: #fff;
    border-radius: 30px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    overflow: hidden;
    z-index: 200;
    transition: all 0.3s ease;
}

/* ==========================================
   🧧 红包发送弹窗（独立设计）
========================================== */

.redpacket-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: linear-gradient(180deg, #d65c6f 0%, #b84355 100%);
    border-radius: 20px;
    padding: 40px 25px 30px;
    box-shadow: 0 30px 60px rgba(184, 67, 85, 0.4);
    z-index: 200;
    position: relative;
}

/* 顶部装饰弧形 */
.rp-modal-arc {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0 0 50% 50%;
    z-index: 0;
    pointer-events: none;
}

.rp-modal-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    position: relative;
    z-index: 1;
}

/* 红包类型选择按钮 */
.rp-type-btn {
    flex: 1;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 5; /* 添加z-index */
}

.rp-type-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.rp-type-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* 金额输入区域 */
.rp-input-group {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2; /* 调整z-index */
}

.rp-symbol {
    font-size: 32px;
    font-weight: 700;
    color: #f5e4c3;
    margin-right: 8px;
    margin-bottom: 8px;
}

.rp-amt-input {
    border: none;
    outline: none;
    font-size: 56px;
    font-weight: 900;
    width: 200px;
    background: transparent;
    color: #fff;
    text-align: center;
}

/* 隐藏金额输入框的上下键 */
.rp-amt-input::-webkit-outer-spin-button,
.rp-amt-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rp-amt-input[type=number] {
    -moz-appearance: textfield;
}

/* 寄语输入框 */
.rp-note-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 15px;
    border-radius: 15px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    outline: none;
    position: relative;
    z-index: 10; /* 提高z-index确保在最上层 */
    cursor: text; /* 明确指示可编辑 */
    min-height: 48px; /* 增加最小高度，更容易点击 */
    -webkit-user-select: text; /* 确保可以选中文本 */
    user-select: text;
}

.rp-note-input:focus {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.rp-note-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* 红包个数选择（拼手气专属） */
.rp-count-group {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 8; /* 添加z-index */
}

.rp-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rp-count-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
}

.rp-count-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px 16px;
    gap: 12px;
    min-height: 44px; /* 增大触摸区域 */
}

.rp-count-input {
    width: 60px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    outline: none;
    padding: 8px 4px; /* 增加内边距，更容易点击 */
    cursor: text;
}

/* 隐藏红包个数输入框的上下键 */
.rp-count-input::-webkit-outer-spin-button,
.rp-count-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rp-count-input[type=number] {
    -moz-appearance: textfield;
}

/* 红包个数增减按钮 */
.rp-count-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.rp-count-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.rp-count-btn:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

.rp-count-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.rp-count-unit {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-left: 4px;
}

.rp-count-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-align: center;
    margin-top: 8px;
}

/* 发送按钮 */
.btn-send-redpacket {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: 2px solid #fff;
    background: linear-gradient(135deg, #fff7e6 0%, #e6c88e 100%);
    color: #b84355;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 15px 30px rgba(184, 67, 85, 0.4), inset 0 2px 6px #fff;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.btn-send-redpacket:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 35px rgba(184, 67, 85, 0.5), inset 0 2px 6px #fff;
}

.btn-send-redpacket:active {
    transform: translateY(0);
}

/* ==========================================
   💰 转账发送弹窗（独立设计）
========================================== */

.transfer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: #fff;
    border-radius: 20px;
    padding: 30px 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 200;
}

/* 顶部金条装饰 */
.transfer-gold-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(135deg, #d4af37 0%, #aa8526 100%);
    border-radius: 20px 20px 0 0;
}

.transfer-modal-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* 收款人头像 */
.transfer-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 3px solid #fff;
    outline: 2px solid #d4af37;
    background: #eee;
    background-size: cover;
    background-position: center;
}

.transfer-payee-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 群聊选择器 */
.transfer-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #f8f8f8;
    font-size: 14px;
    outline: none;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.transfer-select:focus {
    border-color: #d4af37;
    background: #fff;
}

/* 金额输入区域 */
.transfer-input-group {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.transfer-symbol {
    font-size: 32px;
    font-weight: 700;
    color: #d4af37;
    margin-right: 8px;
    margin-bottom: 8px;
}

.transfer-amt-input {
    border: none;
    outline: none;
    font-size: 56px;
    font-weight: 900;
    width: 200px;
    background: transparent;
    color: #333;
    text-align: center;
}

/* 隐藏转账金额输入框的上下键 */
.transfer-amt-input::-webkit-outer-spin-button,
.transfer-amt-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.transfer-amt-input[type=number] {
    -moz-appearance: textfield;
}

/* 备注输入框 */
.transfer-note-input {
    width: 100%;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 12px;
    color: #333;
    font-size: 14px;
    text-align: center;
    margin-bottom: 25px;
    outline: none;
    transition: all 0.3s;
}

.transfer-note-input:focus {
    border-color: #d4af37;
    background: #fff;
}

.transfer-note-input::placeholder {
    color: #999;
}

/* 发送按钮 */
.btn-send-transfer {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #d4af37 0%, #aa8526 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 12px 30px rgba(170, 133, 38, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send-transfer:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(170, 133, 38, 0.4);
}

.btn-send-transfer:active {
    transform: translateY(0);
}

/* 旧的混合样式已删除，红包和转账现在使用独立的弹窗 */

/* ==========================================
   🧧 红包详情页样式
   ========================================== */
.rp-details-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #fdf8f6 0%, #fff 100%);
    z-index: 500;
    display: none !important; /* 🔧 默认隐藏 */
    flex-direction: column;
    overflow: hidden;
}

.rp-details-page.show {
    display: flex !important; /* 🔧 显示时使用 flex */
}

/* 顶部曲线区域 */
.det-top-curve {
    background: linear-gradient(160deg, #d65c6f 0%, #c94a5d 60%, #b8394c 100%);
    padding: 50px 20px 35px;
    border-radius: 0 0 35px 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(214, 92, 111, 0.25);
}

.det-back {
    position: absolute;
    top: 50px;
    left: 16px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    font-size: 15px;
}

.det-back .icon-svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.det-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 16px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.2);
}

.det-sender {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.det-msg {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 6px;
}

.det-amount {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    margin-top: 15px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.det-amount span:first-child {
    font-size: 18px;
    font-weight: 500;
    margin-right: 2px;
}

.det-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 10px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
}

.det-best-label {
    margin-top: 8px;
    font-size: 12px;
    color: #ffd700;
    font-weight: 600;
    transition: opacity 0.3s;
}

/* 领取列表标题 */
.det-list-header {
    padding: 15px 20px 10px;
    font-size: 12px;
    color: #a88d92;
    font-weight: 500;
}

/* 领取列表 */
.det-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 每条领取记录 */
.det-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(214, 92, 111, 0.08);
    box-shadow: 0 2px 10px rgba(214, 92, 111, 0.05);
}

.det-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    margin-right: 14px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(214, 92, 111, 0.1);
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.det-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.det-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #5d5468;
    display: flex;
    align-items: center;
    gap: 6px;
}

.det-item-name .user-badge {
    font-size: 10px;
    color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
    padding: 1px 6px;
    border-radius: 8px;
}

.det-item-time {
    font-size: 11px;
    color: #c4a9ad;
}

.det-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.det-item-amt {
    font-size: 16px;
    font-weight: bold;
    color: #5d5468;
}

.det-item-amt.best {
    color: #d65c6f;
}

/* 手气王标识 */
.luck-best {
    font-size: 10px;
    color: #b8853b;
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fdf8ed 0%, #faebd2 100%);
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid #f2dfc2;
}

.luck-best .icon-sm {
    width: 12px;
    height: 12px;
}

/* 🔧 红包详情页列表样式 - 兼容性别名 */
/* 这些类名是为了兼容不同的红包详情页实现 */
.rp-record-item { 
    display: flex; 
    align-items: center; 
    padding: 15px 20px; 
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-bottom: 8px;
}

.rp-record-avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 8px; 
    margin-right: 12px; 
    object-fit: cover;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(214, 92, 111, 0.1);
    background-color: #f0f0f0;
}

.rp-record-info { 
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rp-record-name { 
    font-size: 15px; 
    font-weight: 600; 
    color: #333; 
    margin-bottom: 4px;
}

.rp-record-time { 
    font-size: 12px; 
    color: #999;
}

.rp-record-amt { 
    text-align: right; 
    font-weight: 700; 
    font-size: 16px; 
    color: #333;
}

.rp-record-amt .best-luck { 
    font-size: 12px; 
    color: #D4AF37; 
    margin-top: 4px; 
    font-weight: normal;
}

/* 容器类 */
.rp-record-list,
.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===============================================
   🌹 高定玫瑰红包系统 (全新重构 v2.0)
   =============================================== */

/* 1. 红包全局变量 */
:root {
    --rose-main: #d65c6f; 
    --rose-light: #e88292; 
    --rose-dark: #b84355; 
    --rose-opened: rgba(214, 92, 111, 0.15); 
    --gold-light: #f5e4c3; 
    --gold-main: #e6c88e; 
    --gold-opened: rgba(230, 200, 142, 0.25);
    --text-dark: #5c4347; 
    --text-sub: #a88d92;
}

/* 2. 聊天气泡通用与特效 */
.rp-bubble {
    width: 245px; 
    border-radius: 20px; 
    display: flex; 
    flex-direction: column; 
    cursor: pointer; 
    position: relative; 
    overflow: hidden; 
    transition: all 0.3s ease;
}
.msg-row.sent .rp-bubble { border-top-right-radius: 6px; }
.msg-row.received .rp-bubble { border-top-left-radius: 6px; }
.rp-content { 
    padding: 16px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    position: relative; 
    z-index: 2; 
}
.rp-text { 
    display: flex; 
    flex-direction: column; 
    gap: 3px; 
    flex-grow: 1; 
    min-width: 0; 
}
.rp-title { 
    font-size: 15px; 
    font-weight: 600; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.rp-subtitle { 
    font-size: 12px; 
    opacity: 0.9; 
    font-weight: 400; 
}
.rp-bottom { 
    padding: 7px 16px; 
    font-size: 11px; 
    z-index: 2; 
    position: relative; 
    letter-spacing: 0.5px; 
}
.rp-bubble::after { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: -100%; 
    width: 50%; 
    height: 100%; 
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); 
    transform: skewX(-20deg); 
    animation: diamondGlow 3.5s infinite; 
    pointer-events: none; 
    z-index: 3; 
}
@keyframes diamondGlow { 
    0% { left: -100%; } 
    20% { left: 200%; } 
    100% { left: 200%; } 
}

/* 3. 专属·普通红包 (纯净玫瑰) */
.rp-bubble.normal { 
    background: linear-gradient(135deg, var(--rose-light) 0%, var(--rose-main) 100%); 
    box-shadow: 0 6px 20px rgba(214, 92, 111, 0.3), inset 0 1px 3px rgba(255,255,255,0.4); 
    border: 1px solid rgba(255,255,255,0.2); 
}
.rp-bubble.normal .rp-icon { 
    width: 36px; 
    height: 42px; 
    position: relative; 
    border-radius: 6px; 
    flex-shrink: 0; 
    background: linear-gradient(135deg, #fdf2d8 0%, #e6c88e 100%); 
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.8), 0 4px 8px rgba(0,0,0,0.08); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.rp-bubble.normal .rp-icon::before { 
    content: ''; 
    position: absolute; 
    width: 22px; 
    height: 22px; 
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%23b84355" xmlns="http://www.w3.org/2000/svg"><path d="M12 12C12 12 8 8 5 9C2 10 3 15 5 16C7 17 12 12 12 12ZM12 12C12 12 16 8 19 9C22 10 21 15 19 16C17 17 12 12 12 12Z"/><circle cx="12" cy="12" r="2" fill="%23d65c6f"/></svg>') no-repeat center; 
}
.rp-bubble.normal .rp-text { 
    color: #fff; 
    text-shadow: 0 1px 2px rgba(184, 67, 85, 0.4); 
}
.rp-bubble.normal .rp-bottom { 
    background: rgba(255,255,255,0.15); 
    color: rgba(255,255,255,0.95); 
    border-top: 1px solid rgba(255,255,255,0.15); 
}

/* 4. 群聊·拼手气红包 (惊艳渐变+金币+水印) */
.rp-bubble.lucky { 
    background: linear-gradient(135deg, #f5a9b8 0%, #d65c6f 40%, #e6c88e 100%); 
    box-shadow: 0 6px 20px rgba(230, 200, 142, 0.5), inset 0 1px 3px rgba(255,255,255,0.6); 
    border: 1px solid rgba(250, 235, 210, 0.6); 
}
.rp-bubble.lucky::before { 
    content: '拼'; 
    position: absolute; 
    right: 10px; 
    bottom: 10px; 
    font-size: 64px; 
    color: rgba(255, 255, 255, 0.15); 
    font-family: "Songti SC", "STSong", serif; 
    font-weight: 900; 
    transform: rotate(-15deg); 
    z-index: 1; 
    pointer-events: none; 
}
.rp-bubble.lucky .rp-icon { 
    width: 42px; 
    height: 42px; 
    position: relative; 
    border-radius: 50%; 
    background: linear-gradient(135deg, #fff7e6 0%, #f5e4c3 100%); 
    box-shadow: inset 0 2px 5px #fff, 0 4px 10px rgba(214, 92, 111, 0.3); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
    border: 2px solid #fff; 
}
.rp-bubble.lucky .rp-icon::before { 
    content: '拼'; 
    color: var(--rose-main); 
    font-size: 20px; 
    font-weight: bold; 
    font-family: "Songti SC", serif; 
}
.rp-bubble.lucky .rp-text { 
    color: #fff; 
    text-shadow: 0 1px 3px rgba(214, 92, 111, 0.6); 
}
.rp-bubble.lucky .rp-bottom { 
    background: rgba(255,255,255,0.25); 
    color: #fff; 
    border-top: 1px solid rgba(255,255,255,0.3); 
    text-shadow: 0 1px 2px rgba(214, 92, 111, 0.4);
}

/* 5. 已领取的空壳状态 */
.rp-bubble.normal.opened { 
    background: var(--rose-opened); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    box-shadow: none; 
    border: 1px solid rgba(214, 92, 111, 0.2); 
}
.rp-bubble.normal.opened::after { display: none; }
.rp-bubble.normal.opened .rp-text { 
    color: var(--rose-dark); 
    text-shadow: none; 
}
.rp-bubble.normal.opened .rp-subtitle { color: #c49ea5; }
.rp-bubble.normal.opened .rp-icon { 
    background: rgba(230, 200, 142, 0.3); 
    box-shadow: none; 
    opacity: 0.7; 
}
.rp-bubble.normal.opened .rp-icon::before { 
    fill: var(--rose-dark); 
    opacity: 0.5; 
}
.rp-bubble.normal.opened .rp-bottom { 
    background: rgba(214, 92, 111, 0.05); 
    color: #c49ea5; 
    border-top: 1px solid rgba(214, 92, 111, 0.1); 
}
.rp-bubble.lucky.opened { 
    background: var(--gold-opened); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    box-shadow: none; 
    border: 1px solid rgba(230, 200, 142, 0.4); 
}
.rp-bubble.lucky.opened::after { display: none; }
.rp-bubble.lucky.opened::before { color: rgba(214, 92, 111, 0.06); }
.rp-bubble.lucky.opened .rp-text { 
    color: #a37936; 
    text-shadow: none; 
}
.rp-bubble.lucky.opened .rp-subtitle { color: #c2a172; }
.rp-bubble.lucky.opened .rp-icon { 
    background: rgba(255,255,255,0.5); 
    border-color: rgba(230, 200, 142, 0.5); 
    box-shadow: none; 
    opacity: 0.8;
}
.rp-bubble.lucky.opened .rp-icon::before { color: #c2a172; }
.rp-bubble.lucky.opened .rp-bottom { 
    background: rgba(230, 200, 142, 0.15); 
    color: #b8853b; 
    border-top: 1px solid rgba(230, 200, 142, 0.3); 
}

/* 6. 系统提示 (领完/手气王) */
.sys-msg-row { 
    display: flex; 
    justify-content: center; 
    margin: 10px 0; 
}
.sys-msg { 
    background: rgba(214, 92, 111, 0.06); 
    border: 1px solid rgba(214, 92, 111, 0.12); 
    padding: 5px 12px; 
    border-radius: 16px; 
    font-size: 11px; 
    color: var(--text-sub); 
    backdrop-filter: blur(10px); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.sys-msg .highlight { 
    color: var(--rose-main); 
    font-weight: 600; 
}

/* 7. 拆包浮层与详情页 */
/* 🔧 重构：显隐由原生 JS 的 style.display 控制，不再依赖 .active 类 */
.modal-overlay { 
    position: absolute; /* 防止脱离手机壳 */
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(250, 247, 248, 0.6); 
    backdrop-filter: blur(15px); 
    z-index: 9999; 
    
    /* 显隐由 JS 的 display 属性控制，默认 display:none 在 HTML 中设置 */
    /* display: none; — 由 JS 控制，不在 CSS 中设置 */
    justify-content: center; 
    align-items: center; 
    /* 移除 opacity/visibility 隐藏，让 display 完全控制 */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease; 
}
.envelope { 
    width: 300px; 
    height: 430px; 
    background: linear-gradient(180deg, var(--rose-main) 0%, var(--rose-dark) 100%); 
    border-radius: 26px; 
    position: relative; 
    box-shadow: 0 30px 60px rgba(184, 67, 85, 0.3), inset 0 2px 10px rgba(255,255,255,0.3); 
    border: 1px solid var(--rose-light); 
    transform: scale(0.8) translateY(40px); 
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.2); 
}
.modal-overlay.active .envelope { 
    transform: scale(1) translateY(0); 
}
.env-top { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 135px; 
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%); 
    border-bottom-left-radius: 50% 30px; 
    border-bottom-right-radius: 50% 30px; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
    z-index: 2; 
    border-bottom: 2px solid rgba(255,255,255,0.2); 
}
.env-content { 
    position: relative; 
    z-index: 3; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding-top: 55px; 
    color: #fff; 
}
.env-avatar { 
    width: 60px; 
    height: 60px; 
    border-radius: 18px; 
    border: 2px solid var(--gold-light); 
    margin-bottom: 12px; 
    background-size: cover; 
    background-position: center;
}
.env-msg { 
    font-size: 20px; 
    font-weight: bold; 
    text-align: center; 
    padding: 0 24px; 
    color: var(--gold-light); 
    margin-top:20px;
}
.coin-btn { 
    width: 90px; 
    height: 90px; 
    background: linear-gradient(135deg, #fff7e6 0%, var(--gold-main) 100%); 
    border-radius: 50%; 
    position: absolute; 
    top: 250px; 
    left: 105px; 
    z-index: 4; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    box-shadow: 0 15px 30px rgba(184, 67, 85, 0.4), inset 0 2px 6px #fff; 
    border: 2px solid #fff; 
    cursor: pointer; 
    color: var(--rose-dark); 
    font-size: 34px; 
    font-weight: 500; 
    font-family: "Songti SC", serif; 
}
.coin-btn.spinning { 
    animation: spin3D 1s infinite cubic-bezier(0.4, 0, 0.2, 1); 
    pointer-events: none; 
    color: transparent; 
    border-color: transparent; 
}
@keyframes spin3D { 
    0% { transform: rotateY(0deg); } 
    100% { transform: rotateY(360deg); } 
}
.modal-close { 
    position: absolute; 
    top: 20px; 
    left: 20px; 
    font-size: 28px; 
    color: #fff; 
    cursor: pointer; 
    z-index: 10000; 
}

/* 详情页 */
/* 🔧 重构：显隐由原生 JS 的 style.display 控制，不再依赖 .active 类 */
#rp-details-view { 
    position: absolute; /* 防止脱离手机壳 */
    top:0; 
    left:0; 
    width:100%; 
    height:100%; 
    background: #faf7f8; 
    z-index: 9998; 
    
    /* 显隐由 JS 的 display 属性控制 */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    overflow-y: auto;
}
.det-top-curve { 
    background: linear-gradient(180deg, rgba(214, 92, 111, 0.1) 0%, rgba(214, 92, 111, 0.0) 100%); 
    border-bottom-left-radius: 40px; 
    border-bottom-right-radius: 40px; 
    padding: 60px 20px 30px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    position: relative; 
}
.det-back { 
    position: absolute; 
    top: 20px; 
    left: 16px; 
    color: var(--rose-dark); 
    cursor: pointer; 
    font-weight: 500; 
    font-size: 15px; 
}
.det-avatar { 
    width: 64px; 
    height: 64px; 
    border-radius: 20px; 
    box-shadow: 0 8px 20px rgba(214, 92, 111, 0.15); 
    margin-bottom: 16px; 
    border: 2px solid #fff; 
    background-size: cover; 
    background-position: center;
}
.det-amount { 
    font-size: 48px; 
    font-weight: bold; 
    color: var(--rose-main); 
    margin-top: 15px; 
}
.det-list-header { 
    padding: 15px 20px 10px; 
    font-size: 12px; 
    color: var(--text-sub); 
    font-weight: 500; 
}
.det-list { 
    padding: 0 16px 30px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}
.det-item { 
    display: flex; 
    align-items: center; 
    padding: 16px; 
    background: rgba(255,255,255,0.7); 
    border-radius: 20px; 
    border: 1px solid rgba(255,255,255,0.8); 
}
.det-item-avatar { 
    width: 44px; 
    height: 44px; 
    border-radius: 14px; 
    margin-right: 14px; 
    background-size: cover; 
    background-position: center; 
    border: 1px solid rgba(214, 92, 111, 0.1); 
}
.det-item-info { 
    flex: 1; 
}
.det-item-name { 
    font-size: 14px; 
    font-weight: 600; 
    color: var(--text-dark); 
}
.det-item-time { 
    font-size: 11px; 
    color: var(--text-sub); 
    margin-top: 2px; 
}
.det-item-right { 
    text-align: right; 
}
.det-item-amt { 
    font-size: 16px; 
    font-weight: bold; 
    color: var(--text-dark); 
}
.luck-best { 
    font-size: 11px; 
    color: var(--rose-main); 
    margin-top: 4px; 
    display: flex; 
    align-items: center; 
    gap: 2px; 
}
.luck-best .icon-svg { 
    width: 12px; 
    height: 12px; 
}

/* ================= 发红包弹窗 (高定玫瑰风) ================= */
.send-rp-box {
    width: 320px; 
    background: #faf7f8; 
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15); 
    overflow: hidden;
    transform: translateY(20px); 
    transition: transform 0.3s ease;
}
.modal-overlay.active .send-rp-box { 
    transform: translateY(0); 
}
.send-rp-header {
    background: linear-gradient(135deg, var(--rose-light) 0%, var(--rose-main) 100%);
    color: #fff; 
    padding: 18px; 
    text-align: center; 
    font-size: 16px; 
    font-weight: bold;
    letter-spacing: 1px;
}
.send-rp-body { 
    padding: 24px; 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
}
.send-rp-row {
    display: flex; 
    align-items: center; 
    background: #fff; 
    border-radius: 12px;
    padding: 12px 16px; 
    box-shadow: 0 2px 8px rgba(214, 92, 111, 0.05);
}
.send-rp-row span { 
    color: var(--text-dark); 
    font-size: 15px; 
    font-weight: 500; 
    white-space: nowrap;
}
.send-rp-row input {
    flex: 1; 
    border: none; 
    outline: none; 
    background: transparent;
    text-align: right; 
    font-size: 15px; 
    color: var(--text-dark); 
    padding: 0 10px;
}
.send-rp-row input::placeholder { 
    color: #d0c4c6; 
}
.send-rp-amount-show {
    text-align: center; 
    font-size: 40px; 
    font-weight: bold; 
    color: var(--text-dark);
    margin: 10px 0; 
    font-family: -apple-system, sans-serif;
}
.send-rp-btn {
    background: linear-gradient(135deg, var(--rose-main) 0%, var(--rose-dark) 100%);
    color: #fff; 
    border: none; 
    border-radius: 25px; 
    padding: 14px; 
    font-size: 16px;
    font-weight: bold; 
    cursor: pointer; 
    box-shadow: 0 6px 16px rgba(214, 92, 111, 0.3);
    transition: transform 0.1s;
}
.send-rp-btn:active { 
    transform: scale(0.96); 
}

/* 拼手气红包标签 */
.send-rp-type-tag {
    text-align: center;
    font-size: 13px;
    color: #f5a623;
    background: linear-gradient(135deg, #fff8e6 0%, #fff3d6 100%);
    padding: 8px 16px;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed rgba(214, 92, 111, 0.15);
}

/* 拼手气红包提示 */
.send-rp-hint {
    text-align: center;
    font-size: 12px;
    color: #b8a090;
    margin: -8px 0 4px 0;
}

/* ===== 旁白样式：蓝灰小字不斜体 ===== */
.action-narration-text .action-text,
.msg-row.action-narration .action-text {
    font-style: normal !important;
    font-size: 13px !important;
    color: var(--aside-color, #78909c) !important;
    line-height: 1.8 !important;
    letter-spacing: 0.3px;
    opacity: 0.88;
}
/* ===== 旁白样式结束 ===== */
