/* CSS变量定义 */
:root {
    /* 主色调 - 低饱和灰 */
    --pink-50: #fbfbfb;
    --pink-100: #f5f5f5;
    --pink-200: #e8e8e8;
    --pink-300: #d4d4d4;
    --pink-400: #bfbfbf;
    --pink-500: #a6a6a6;
    --pink-600: #808080;
    --pink-accent: #666666;
    --pink-muted: #999999;

    /* 背景色 */
    --bg-primary: #f5f5f5;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-card: #ffffff;

    /* 界面色 */
    --interface-bg: #fafafa;
    --msg-name-color: #888888;
    --msg-time-color: #aaaaaa;

    /* 文字色 */
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #888888;

    /* 气泡色 */
    --bubble-sent: #e2e2e2;
    --bubble-received: #ffffff;
    --bubble-sent-text: #111111;
    --bubble-received-text: #111111;

    /* 开关/强调色 */
    --accent-toggle: #555555;
    --accent-gradient: linear-gradient(135deg, #dfdfdf 0%, #f0f0f0 100%);
    --accent-gradient-vivid: linear-gradient(135deg, #cccccc 0%, #e0e0e0 100%);
}

/* CSS样式 */
/* 全局隐藏滚动条 */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

html {
    height: 100%;
    height: 100dvh;
    height: var(--app-height-stable, 100dvh);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    background-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    height: 100%;
    height: 100dvh;
    height: var(--app-height-stable, 100dvh);
    overflow: hidden;
}

/* 手机容器 */
#phone-container {
    width: 100%;
    height: 100%;
    height: 100dvh;
    height: var(--app-height-stable, 100dvh);
    border: none;
    border-radius: 0;
    background: var(--bg-primary);
    background-size: cover;
    background-position: center;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    transition: none !important;
}

/* 顶部状态栏 */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 3000;
    font-size: 13px;
    font-weight: 600;
    box-sizing: border-box;
    pointer-events: none;
}

.status-bar.text-dark {
    color: var(--text-primary);
}

.status-bar.text-dark svg {
    fill: var(--text-primary);
}

.status-bar.text-light {
    color: #fff;
}

.status-bar.text-light svg {
    fill: #fff;
}

.sb-left {
    width: 60px;
    text-align: center;
}

.sb-right {
    width: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* --- 屏幕管理 --- */
.screen {
    flex: 1;
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s, filter 0.4s;
    overflow: hidden;
    background-color: var(--bg-primary);
    /* 修复窄屏下页面左右晃动的问题 */
    overflow-x: hidden;
    box-sizing: border-box;
}

#home-screen {
    display: flex;
    z-index: 1;
    padding-top: 0;
    align-items: center;
    overflow-x: hidden;
    width: 100%;
    justify-content: center;
    background-color: var(--pink-100);
    background-image: linear-gradient(160deg, var(--pink-50) 0%, var(--pink-100) 40%, var(--pink-200) 100%);
    opacity: 1;
}

/* 移除.slide-out 动画 */

/* 主屏幕时间 */
#home-clock {
    font-family: 'Dancing Script', 'Ma Shan Zheng', cursive, sans-serif;
    font-size: 60px;
    letter-spacing: 4px;
    color: var(--pink-600);
    margin-bottom: 80px;
    font-weight: normal;
    text-shadow: 0 2px 8px rgba(119, 119, 119, 0.15);
    z-index: 5;
}

/* 子页面 */
#message-list-screen {
    z-index: 8;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
    background-color: var(--bg-primary);
}

/* Right side sliders */
#chat-screen {
    z-index: 10;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
    background-color: var(--interface-bg);
    /* 聊天屏幕使用动态高度，键盘弹出时自动收缩 */
    height: var(--app-height, 100%) !important;
}

#chat-settings-screen {
    z-index: 20;
    /* Ensure it covers the chat screen */
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
    background-color: var(--bg-primary);
}

/* Left side sliders */
#settings-screen {
    z-index: 10;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
}

#nai-settings-screen {
    z-index: 15;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    background-color: var(--bg-primary);
}

/* 移除 visible 状态动画 */

/* Message List Styles */
.message-list-body,
.contacts-list-body,
.me-body,
.moments-body {
    flex: 1;
    background: var(--bg-tertiary);
    overflow-y: auto;
    padding-bottom: 60px;
}


.message-list-item {
    display: flex;
    padding: 12px 15px;
    border-bottom: 1px solid var(--pink-200);
    cursor: pointer;
    align-items: center;
    transition: background-color 0.2s;
    background-color: var(--bg-card);
}

.message-list-item:active {
    background-color: var(--pink-100);
}

.message-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 0;
    margin-right: 12px;
    object-fit: cover;
    background-color: #eee;
}

.message-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

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

.message-list-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.message-list-time {
    font-size: 12px;
    color: var(--text-muted);
}

.message-list-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 10px;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 50px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    width: 100%;
    min-width: 0;
}

.app-item:active {
    opacity: 0.7;
    transform: scale(0.95);
    transition: 0.1s;
}

.app-icon-box {
    width: 100%;
    max-width: 58px;
    aspect-ratio: 1/1;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: inset 2px 2px 8px rgba(255, 255, 255, 0.7), inset -2px -3px 6px rgba(0, 0, 0, 0.03), 0 5px 15px rgba(0, 0, 0, 0.05);
    opacity: 0.9;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* 一组莫奈风格色块与不规则鹅卵石形状交替 */
.app-item:nth-child(4n+1) .app-icon-box {
    border-radius: 42% 58% 52% 48% / 50% 45% 55% 50%;
    background-color: rgba(235, 235, 235, 0.6);
}

.app-item:nth-child(4n+2) .app-icon-box {
    border-radius: 46% 54% 48% 52% / 48% 50% 50% 52%;
    background-color: rgba(230, 230, 230, 0.6);
}

.app-item:nth-child(4n+3) .app-icon-box {
    border-radius: 52% 48% 54% 46% / 55% 52% 48% 45%;
    background-color: rgba(225, 225, 225, 0.6);
}

.app-item:nth-child(4n+4) .app-icon-box {
    border-radius: 48% 52% 45% 55% / 50% 55% 45% 50%;
    background-color: rgba(220, 220, 220, 0.6);
}

.app-icon-box svg {
    width: 55%;
    height: 55%;
    transition: fill 0.3s;
    fill: var(--pink-600);
}

.app-icon-image {
    width: 55%;
    height: 55%;
    background-color: var(--pink-600);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    transition: background-color 0.3s;
}

.app-name {
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(100, 100, 100, 0.15);
    color: var(--pink-600);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header */
.app-header {
    height: 80px;
    padding-top: 40px;
    display: flex;
    align-items: center;
    padding-left: 15px;
    padding-right: 15px;
    /* 默认背景色 */
    background-color: var(--interface-bg);
    border-bottom: 1px solid rgba(200, 200, 200, 0.12);
    flex-shrink: 0;
    z-index: 10;
    box-sizing: border-box;
    transition: background-color 0.3s;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    position: absolute;
    left: 0;
}

.header-btn-right {
    left: auto;
    right: 0;
    justify-content: flex-end;
}

.header-btn svg {
    width: 24px;
    height: 24px;
    fill: #181818;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    max-width: 66%;
}

/* Chat Area */
#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* scroll-behavior: auto — instant jump to bottom, no animation */
    scrollbar-width: none;
}

#chat-messages::-webkit-scrollbar {
    display: none;
}

.settings-body::-webkit-scrollbar {
    display: none;
}

/* Blocked Status Icon */
.msg-status-blocked {
    color: #ff3b30;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: help;
    flex-shrink: 0;
    line-height: 1.2;
}

/* Message Meta Container (Time + Status) */
.msg-meta {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 1px;
    margin-bottom: 0px;
}

/* Adjust margins for meta container based on sender */
.message-row.sent .msg-meta {
    margin-right: 2px;
}

.message-row.received .msg-meta {
    margin-left: 2px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    vertical-align: middle;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--pink-300);
    transition: .4s;
    border-radius: 0;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 0;
}

input:checked+.slider {
    background-color: var(--pink-accent);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--pink-accent);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Add Contact Styles */
.contact-type-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
    padding-bottom: 5px;
}

.contact-type-tabs .tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    position: relative;
    transition: color 0.3s;
}

.contact-type-tabs .tab.active {
    color: var(--text-primary);
    font-weight: bold;
}

.contact-type-tabs .tab.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #555;
    border-radius: 0;
}

.group-input-item {
    margin-top: 8px;
}

/* Avatar Grid in Settings */
.avatar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
}

.avatar-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.avatar-sq {
    width: 48px;
    height: 48px;
    border-radius: 0;
    /* Rounded Square */
    object-fit: cover;
    background: #eee;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.1s;
}

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

.avatar-name {
    font-size: 11px;
    color: #666;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Avatar Pair (private chat settings) */
.avatar-pair-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.avatar-pair-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.avatar-pair-img {
    width: 48px;
    height: 48px;
    border-radius: 0;
    object-fit: cover;
    background: #eee;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.1s;
}

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

.avatar-pair-label {
    font-size: 11px;
    color: #666;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
}

.location-card,
.transfer-card,
.file-card,
.link-card,
.deliver-card,
.photo-card,
.real-audio-card,
.redpacket-card,
.forum-share-card,
.toyinvite-card {
    border-radius: 10px !important;
}

/* Message Styles */
/* Love Effect */
.love-effect-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
}

.love-heart {
    position: absolute;
    bottom: -20px;
    font-size: 24px;
    animation: floatUp 4s ease-in-out forwards;
    opacity: 0;
}

/* Typing indicator without avatar: make bubble align like received messages */
.typing-only {
    margin-left: 0;
    border-radius: 0;
}

/* Group badge near name: 5px spacing and slight upward offset */
.group-badge {
    font-size: 10px;
    color: #999;
    background: #f0f0f0;
    padding: 1px 4px;
    border-radius: 0;
    margin-left: 5px;
    position: relative;
    top: -1px;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translateY(-600px) scale(1.5);
        opacity: 0;
    }
}

/* Group input button styles */
.group-add-btn,
.group-remove-btn {
    transition: background 0.12s ease, transform 0.08s ease;
}

.group-add-btn:hover,
.group-remove-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.group-add-btn:active,
.group-remove-btn:active {
    transform: scale(0.96);
}

/* 消息行容器：包含头像、消息内容、时间等 */
.message-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
}

/* 发送方（右侧）样式 */
.message-row.sent {
    flex-direction: row-reverse;
}

/* 接收方（左侧）样式 */
.message-row.received {
    flex-direction: row;
}

/* 左右侧消息切换时的额外间距 */
.message-row.sent+.message-row.received,
.message-row.received+.message-row.sent {
    margin-top: 18px;
}

/* 同方向连续消息间距 */
.message-row.sent+.message-row.sent,
.message-row.received+.message-row.received {
    margin-top: 5px;
}

/* 头像样式 */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 0;
    background-color: #e0e0e0;
    object-fit: cover;
    flex-shrink: 0;
    border: none;
    margin-top: -8px;
    transition: margin-top 0.2s;
    /* 添加平滑过渡，若以后有动态切换能显得没那么生硬 */
}

/* 名字显示时的头像偏移，为了让气泡和头像始终保持相对位置不变 */
.message-row.has-name .avatar {
    margin-top: 10px;
}

/* 消息内容容器：包含名字、气泡、心声等 */
.msg-container {
    display: flex;
    flex-direction: column;
    max-width: 65%;
}

.message-row.sent .msg-container {
    align-items: flex-end;
}

.message-row.received .msg-container {
    align-items: flex-start;
}

/* 名字样式 (群聊中显示发送者名字) */
.msg-name {
    font-size: 12px;
    color: var(--msg-name-color);
    margin: 0 2px 6px 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    padding-left: 4px;
}

.message-row.sent .msg-name {
    padding-left: 0;
    padding-right: 4px;
    text-align: right;
}

/* 气泡和时间的包装器 */
.msg-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 3px;
    margin-top: 0px;
}

.message-row.sent .msg-wrapper {
    flex-direction: row-reverse;
}

.message-row.received .msg-wrapper {
    flex-direction: row;
}

/* 心声气泡样式 */
.msg-thought {
    font-size: 12px;
    color: #666;
    background-color: rgba(219, 219, 219, 0.8);
    border-radius: 12px;
    padding: 5px 12px;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.4;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
    font-style: italic;
    border: 1px dashed rgba(180, 180, 180, 0.5);
}

/* 引用消息显示在气泡上方，无缝衔接 */
.msg-quote-above {
    margin-bottom: 0;
    font-style: normal;
}

/* 双语消息翻译样式 */
.msg-translation-divider {
    border-top: 1px dashed rgba(150, 150, 150, 0.4);
    margin: 6px -4px;
    height: 0;
}

.msg-translation {
    font-size: 12px;
    color: rgba(100, 100, 100, 0.85);
    line-height: 1.5;
    word-break: break-word;
    padding-top: 2px;
}

/* 发送方的翻译文字颜色调整 */
.bubble-sent .msg-translation {
    color: rgba(255, 255, 255, 0.7);
}

.bubble-sent .msg-translation-divider {
    border-top-color: rgba(255, 255, 255, 0.25);
}

/* 思考过程样式 (DeepSeek R1) */
.msg-thinking-container {
    margin-bottom: 5px;
    max-width: 100%;
}

.thinking-toggle {
    font-size: 10px;
    color: #999;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0;
    user-select: none;
    transition: background 0.2s;
}

.thinking-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.thinking-content {
    font-size: 11px;
    color: #666;
    background-color: rgba(240, 240, 240, 0.5);
    border-left: 3px solid #d0d0d0;
    padding: 6px 8px;
    margin-top: 4px;
    border-radius: 0;
    white-space: pre-wrap;
    line-height: 1.4;
    display: none;
    font-family: monospace;
}

.thinking-content.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 所有气泡类型的通用样式 */
.bubble,
.location-card,
.transfer-card,
.file-card,
.link-card,
.deliver-card,
.voice-card-container,
.photo-card,
.sticker-bubble,
.real-audio-card {
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
    max-width: 100%;
}

/* 按压效果 */
.bubble.pressing,
.location-card.pressing,
.transfer-card.pressing,
.file-card.pressing,
.link-card.pressing,
.deliver-card.pressing,
.voice-card-container.pressing,
.photo-card.pressing,
.sticker-bubble.pressing,
.real-audio-card.pressing {
    transform: scale(0.98);
    filter: brightness(0.95);
}

/* 普通文本气泡样式 */
.bubble {
    padding: 7px 14px;
    border-radius: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line;
    font-size: var(--msg-font-size, 14px);
}

/* 自定义字体时增加气泡内边距，防止文字被裁切 */
.custom-font-active .bubble {
    padding-top: 10px;
    padding-bottom: 10px;
    line-height: 1.65;
}

.custom-font-active .voice-text-bubble {
    padding-top: 9px;
    padding-bottom: 9px;
    line-height: 1.65;
}

/* 发送方文本气泡 */
.bubble-sent {
    background: var(--bubble-sent);
    color: var(--bubble-sent-text);
    border-radius: 14px 4px 14px 14px;
}

/* 接收方文本气泡 */
.bubble-received {
    background: var(--bubble-received);
    color: var(--bubble-received-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-radius: 4px 14px 14px 14px;
}

/* 消息时间样式 */
.msg-time {
    font-size: 10px;
    color: var(--msg-time-color);
    line-height: 1;
    user-select: none;
    padding: 0 2px;
    margin-bottom: 0px;
    flex-shrink: 0;
    min-width: 28px;
}

.message-row.sent .msg-time {
    text-align: right;
}

.message-row.received .msg-time {
    text-align: left;
}

/* 图片/视频卡片样式 */
.photo-card {
    border-radius: 0;
    padding: 6px;
    overflow: visible;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    font-size: 0;
    max-width: 160px;
    width: 100%;
    box-sizing: border-box;
}

.photo-card.sent {
    border-top-right-radius: 0;
    background: var(--bubble-sent);
}

.photo-card.received {
    border-top-left-radius: 0;
    background: var(--bubble-received);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.photo-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

/* 图片占位卡片 (AI发图文字描述) */
.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 16px 12px;
    background: linear-gradient(145deg, #f3f3f5, #e8e8ec);
    border-radius: 0;
    gap: 10px;
    font-size: 12px;
    box-sizing: border-box;
}

.photo-placeholder-icon {
    opacity: 0.45;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-placeholder-text {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
    text-align: center;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

/* 表情包气泡样式 */
.sticker-bubble {
    border-radius: 0;
    overflow: visible;
    font-size: 0;
    max-width: 120px;
}

.sticker-bubble img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

/* 语音卡片容器 */
.voice-card-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

/* 发送方右对齐 */
.voice-card-container.sent {
    align-items: flex-end;
}

/* 接收方左对齐 */
.voice-card-container.received {
    align-items: flex-start;
}

/* 模拟语音卡片样式 - 仅包含语音条 */
.voice-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 18px;
    position: relative;
    word-break: break-word;
    white-space: normal;
    cursor: pointer;
}

.voice-card.sent {}

.voice-card.received {}

.voice-card:active {
    opacity: 0.8;
}

.voice-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    padding: 7px 14px;
    margin: 0;
    color: inherit;
}

.voice-card.sent .voice-bar {
    flex-direction: row-reverse;
}

.voice-duration {
    font-size: 14px;
    font-weight: 500;
    min-width: 12px;
    padding: 0 3px;
    text-align: center;
}

.voice-waves {
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 100%;
    justify-content: flex-start;
    overflow: hidden;
    margin: 0;
}

.wave {
    width: 2px;
    background-color: currentColor;
    border-radius: 0;
    opacity: 0.7;
}

/* 语音文字气泡 - 单独的小气泡 */
.voice-text-bubble {
    font-size: var(--msg-font-size, 14px);
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: none;
    padding: 7px 10px;
    margin: 0;
    margin-top: 0;
    flex-shrink: 0;
    border-radius: 6px !important;
}

/* Show text state - 显示文字气泡 */
.voice-card-container.show-text .voice-text-bubble {
    display: block;
}

/* 真实音频卡片样式 */
.real-audio-card {
    padding: 5px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 220px;
}

.real-audio-card audio {
    max-width: 100%;
    height: 32px;
}

.real-audio-card.sent {
    border-top-right-radius: 0;
    background: var(--bubble-sent);
}

.real-audio-card.received {
    border-top-left-radius: 0;
    background: #ffffff;
}

/* 位置、转账、文件卡片通用样式 */
.location-card,
.transfer-card,
.file-card {
    width: 220px;
    box-sizing: border-box;
    overflow: visible;
}

/* 链接、配送、论坛卡片通用样式 */
.link-card,
.deliver-card,
.forum-share-card {
    width: 220px;
    box-sizing: border-box;
    overflow: hidden;
}

/* ========== 论坛分享卡片 ========== */
.forum-share-card {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: block;
    width: 220px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.forum-share-card:active {
    transform: scale(0.97);
}

.forum-share-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #eef0f4 0%, #e4e7ed 100%);
}

.forum-share-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #7a8baa;
}

.forum-share-icon svg {
    width: 100%;
    height: 100%;
}

.forum-share-header-text {
    font-size: 13px;
    font-weight: 700;
    color: #5a6a8a;
}

.forum-share-mid {
    padding: 10px 12px 6px;
}

.forum-share-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-share-preview {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-share-bottom {
    padding: 6px 12px 10px;
}

.forum-share-meta {
    font-size: 11px;
    color: #aaa;
}

/* ========== 位置卡片 - 仿真地图风格 ========== */
.location-card {
    background: white;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: none;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.location-card:active {
    transform: scale(0.97);
}

.location-info {
    padding: 12px 14px 10px;
    background: #fff;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    text-align: left;
}

.location-name {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
    margin: 0;
    text-align: left;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.location-address {
    font-size: 11px !important;
    color: #999 !important;
    opacity: 1 !important;
    margin-top: 2px !important;
    line-height: 1.3;
    text-align: left;
}

.location-map {
    width: 100%;
    height: 85px;
    background-color: #eaf5ef;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="100" viewBox="0 0 240 100"><defs><linearGradient id="g" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="%23e8f4ec"/><stop offset="100%" stop-color="%23d4eadf"/></linearGradient></defs><rect width="240" height="100" fill="url(%23g)"/><path d="M0,40 Q30,20 60,35 T120,30 T180,45 T240,35" stroke="%23b8d4c8" stroke-width="12" fill="none" opacity="0.4"/><path d="M0,60 Q40,50 80,65 T160,55 T240,60" stroke="%23a8c8b8" stroke-width="8" fill="none" opacity="0.3"/><path d="M20,80 Q60,60 100,80 T180,75" stroke="%23c8d8c8" stroke-width="4" fill="none" opacity="0.5"/><rect x="90" y="20" width="20" height="14" rx="2" fill="%23e0d0c0" opacity="0.3"/><rect x="140" y="35" width="15" height="10" rx="1" fill="%23d8c8b8" opacity="0.25"/><rect x="50" y="45" width="12" height="8" rx="1" fill="%23d0c0b0" opacity="0.2"/><circle cx="120" cy="50" r="6" fill="%23ff5252" opacity="0.9"/><circle cx="120" cy="50" r="10" fill="%23ff5252" opacity="0.15"/><circle cx="120" cy="50" r="16" fill="%23ff5252" opacity="0.06"/></svg>');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    position: relative;
}

.location-map::after {
    content: '查看位置 ›';
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 0;
    backdrop-filter: blur(4px);
}

.location-pin {
    width: 26px;
    height: 26px;
    fill: #ff5252;
    filter: drop-shadow(0 3px 6px rgba(255, 82, 82, 0.35));
    margin-bottom: 10px;
    animation: locationBounce 2s ease-in-out infinite;
}

@keyframes locationBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* ========== 商品链接卡片 ========== */
.link-card {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: block;
    width: 220px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.link-card:active {
    transform: scale(0.97);
}

.link-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f0a050 0%, #e8924a 100%);
}

.link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #fff;
}

.link-icon svg {
    width: 100%;
    height: 100%;
}

.link-header-text {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.link-mid {
    padding: 10px 12px 6px;
}

.link-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-bottom {
    padding: 6px 12px 10px;
}

.link-price {
    font-size: 15px;
    font-weight: 700;
    color: #ff5722;
}

/* ========== 外卖/配送卡片 ========== */
.deliver-card {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 220px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.deliver-card:active {
    transform: scale(0.97);
}

.deliver-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #7ba4c9 0%, #6b9fca 100%);
}

.deliver-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #fff;
}

.deliver-icon svg {
    width: 100%;
    height: 100%;
}

.deliver-shop {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deliver-mid {
    padding: 10px 12px 6px;
}

.deliver-summary {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deliver-bottom {
    padding: 6px 12px 10px;
}

.deliver-total {
    font-size: 15px;
    font-weight: 700;
    color: #ff5722;
}

/* ========== 代付状态 ========== */
.fp-status {
    padding: 6px 12px;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.fp-status.accepted {
    color: #34c759;
}

.fp-status.rejected {
    color: #ff3b30;
}

.link-card.completed,
.deliver-card.completed {
    opacity: 0.85;
    pointer-events: none;
}

/* ========== 红包卡片 ========== */
.redpacket-card {
    background: #f7a04f;
    border-radius: 0;
    padding: 14px 14px 10px;
    color: white;
    width: 220px;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(247, 160, 79, 0.3), 0 2px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, background 0.3s;
}

.redpacket-card.completed {
    background: #fadca3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.redpacket-card.completed .redpacket-icon {
    color: #fcebc7;
}

.redpacket-card:active {
    transform: scale(0.97);
}

.redpacket-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.redpacket-icon {
    width: 30px;
    height: 34px;
    color: #fce7b1;
    flex-shrink: 0;
}

.redpacket-icon svg {
    width: 100%;
    height: 100%;
}

.redpacket-text {
    flex: 1;
    overflow: hidden;
}

.redpacket-note {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.redpacket-bottom {
    font-size: 11px;
    margin-top: 12px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    opacity: 0.85;
}

/* ========== 转账卡片 - 微信红包风格 ========== */
.transfer-card {
    background: linear-gradient(135deg, #ff9a9e 0%, #ffa8a8 50%, #ffb3b3 100%);
    border-radius: 0;
    box-shadow: 0 6px 20px rgba(255, 120, 120, 0.25), 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.transfer-card:active {
    transform: scale(0.97);
}

.transfer-card.completed {
    background: linear-gradient(135deg, #ffd0d0, #ffe0e0);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.transfer-top {
    padding: 16px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    position: relative;
}

.transfer-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
}

.transfer-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: 2px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.transfer-icon-circle svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

.transfer-content {
    flex: 1;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transfer-amount {
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.transfer-note {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.transfer-bottom {
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 14px;
    font-size: 11px;
    color: #c97878;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ========== 文件卡片 - 精致文档风格 ========== */
.file-card {
    background: white;
    border-radius: 0;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.file-card:active {
    transform: scale(0.97);
}

.file-info {
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    word-break: break-all;
}

.file-size {
    font-size: 10px;
    color: #aaa;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.file-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: #8f8f8f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.file-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

/* Media Preview Bar */
#media-preview-bar {
    display: none;
    padding: 8px 12px;
    background: #fff;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    z-index: 10;
    align-items: center;
}

#chat-screen #media-preview-bar,
#chat-settings-screen #media-preview-bar {
    background: var(--interface-bg);
}

#media-preview-bar.visible {
    display: flex;
}

.preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 0;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.preview-file-icon {
    font-size: 24px;
}

.preview-close {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ff5555;
    color: white;
    border-radius: 0;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

/* Input Bar */
#input-bar {
    display: flex;
    padding: 2px 5px 12px 5px;
    border-top: none;
    /* No white line */
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    align-items: flex-end;
    flex-shrink: 0;
    z-index: 10;
    /* 减小输入框与上边缘间隙 */
    padding-bottom: 12px;
    transition: background-color 0.3s;
}

#chat-screen #input-bar {
    background-color: var(--interface-bg);
}

#chat-settings-screen #input-bar {
    background-color: #fff;
}

#input-bar textarea {
    margin-top: 5px;
    flex: 1;
    border: none;
    border-radius: 6px;
    padding: 12px 10px;
    font-size: 15px;
    resize: none;
    max-height: 80px;
    outline: none;
    min-height: 20px;
    background: rgba(252, 228, 232, 0.35);
    color: #000;
    margin-right: 4px;
    scrollbar-width: none;
    /* Firefox */
    overflow-y: auto;
    box-sizing: border-box;
    /* 隐藏滚动条 */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

#input-bar textarea::-webkit-scrollbar {
    display: none;
}

#input-bar textarea::-webkit-scrollbar {
    display: none;
}

/* Chrome/Safari */

.toolbar-btn {
    background: transparent;
    color: var(--chat-btn-text, #333);
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 6px;
    border-radius: 0;
}

.toolbar-btn:hover {
    opacity: 0.95;
}

.toolbar-btn svg {
    width: 25px;
    height: 25px;
    stroke: var(--chat-btn-text, #580000);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.2s;
}

* {
    -webkit-tap-highlight-color: transparent;
}

.toolbar-btn.active svg {
    transform: none;
}

#plus-button {
    margin-right: 0px;
    padding: 0;
}

#emoji-button {
    margin-left: 0px;
    margin-right: 4px;
}

#send-button {
    background: transparent;
    color: var(--chat-btn-text, #d4778a);
    border-radius: 0;
    height: 32px;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
    margin-left: 0px;
    margin-bottom: 5px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: none;
}

#send-button:hover {
    opacity: 0.9;
}

/* Menus */
#action-menu,
#emoji-menu {
    height: 0;
    background: var(--pink-50);
    border-top: none;
    transition: height 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 10;
}

#action-menu {
    display: flex;
    flex-direction: column;
    padding: 0;
}

#action-menu.open {
    height: 220px;
    padding: 0 0 8px 0;
    border-top: 1px solid #e5e5e5;
}

.action-pages-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    scrollbar-width: none;
}

.action-pages-wrapper::-webkit-scrollbar {
    display: none;
}

.action-page {
    min-width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 20px 8px;
    box-sizing: border-box;
    scroll-snap-align: start;
    align-content: start;
}

.action-page-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding-bottom: 4px;
}

.action-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d0d0d0;
    transition: background 0.2s;
}

.action-dot.active {
    background: #888;
}

#emoji-menu {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 0 15px;
    overflow-y: auto;
    box-sizing: border-box;
    align-content: flex-start;
}

#emoji-menu.open {
    height: 220px;
    padding: 15px;
    border-top: 1px solid #e5e5e5;
}

#emoji-menu::-webkit-scrollbar {
    display: none;
}

/* Quote Block */
.msg-quote {
    margin-bottom: 6px;
    margin-top: 0;
    padding: 8px 10px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0;
    font-size: 12px;
    color: #555;
    display: flex;
    flex-direction: column;
    position: relative;
    user-select: none;
    border-left: 2px solid #d0d0d0;
}

.msg-quote-content {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

/* Message Action Menu */
.msg-action-menu {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 4px;
    display: flex;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center bottom;
}

.msg-action-menu.top {
    transform-origin: center top;
}

.msg-action-menu::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.05));
}

.msg-action-menu.top::after {
    top: -6px;
    bottom: auto;
    border-width: 0 6px 6px;
    border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.05));
}

.msg-action-item {
    padding: 8px 14px;
    cursor: pointer;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-action-item:last-child {
    border-right: none;
}

.msg-action-item:active {
    background-color: #f5f0f6;
}

.msg-action-icon {
    width: 16px;
    height: 16px;
    display: block;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.msg-action-item:active .msg-action-icon {
    transform: scale(0.9);
    opacity: 1;
}

/* ========== 多选模式 ========== */

/* 多选复选框 */
.multi-select-checkbox {
    width: 11px;
    height: 11px;
    border-radius: 0;
    border: 1.5px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: center;
    margin: 0 2px;
}

.ms-selected .multi-select-checkbox {
    border-color: #666;
    background: #666;
}

.ms-check-inner {
    width: 5px;
    height: 5px;
    border-radius: 0;
    background: transparent;
    transition: all 0.2s ease;
}

.ms-selected .ms-check-inner {
    background: #fff;
    transform: scale(1);
}

/* 选中行高亮 */
.message-row.ms-selected {
    background: rgba(255, 154, 158, 0.08);
    border-radius: 0;
}

/* 多选模式下的消息行布局调整 */
.multi-select-mode .message-row {
    cursor: pointer;
}

.multi-select-mode .message-row.system .multi-select-checkbox {
    display: none;
}

.multi-select-mode .message-row.system.ms-selected {
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
}

/* 底部工具栏 */
#multi-select-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    z-index: 100;
    animation: slideUpIn 0.25s ease;
}

@keyframes slideUpIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ms-toolbar-left {
    display: flex;
    align-items: center;
}

.ms-count {
    font-size: 13px;
    color: #666;
}

.ms-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-btn {
    padding: 6px 18px;
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ms-btn-delete {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
}

.ms-btn-delete:active {
    transform: scale(0.95);
}

.ms-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.ms-btn-cancel:active {
    background: #e0e0e0;
    transform: scale(0.95);
}

/* Transfer Modal */
.transfer-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.transfer-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.transfer-modal {
    width: 280px;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.transfer-modal-overlay.visible .transfer-modal {
    transform: scale(1);
}

.transfer-header {
    width: 100%;
    padding: 30px 0 20px;
    text-align: center;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.transfer-icon-large {
    width: 50px;
    height: 50px;
    background: #ffacac;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.transfer-icon-large svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
}

.transfer-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.transfer-amount-large {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.transfer-actions {
    width: 100%;
    padding: 0 20px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
}

.transfer-btn {
    flex: 1;
    padding: 9px 14px;
    border: none;
    border-radius: 0;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.transfer-btn-receive {
    background: #333;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transfer-btn-return {
    background: #f2f2f7;
    color: #555;
    border: 1px solid #ddd;
}

.transfer-btn:active {
    transform: scale(0.97);
}

.transfer-btn-receive:active {
    background: #444;
}

.transfer-btn-return:active {
    background: #e5e5ea;
}

.transfer-info-text {
    width: 100%;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.transfer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
    font-size: 12px;
}

.action-icon-box {
    width: 55px;
    height: 55px;
    background: #fff;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e5;
}

.sticker-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.sticker-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 0;
    background: #fff;
}

.sticker-add-btn {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    border-radius: 0;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
    box-sizing: border-box;
}

.sticker-add-btn svg {
    width: 28px;
    height: 28px;
    fill: #999;
}

.sticker-name {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Modals */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#input-modal {
    z-index: 210;
}

/* Ensure input modal is on top */
.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    box-sizing: border-box;
    width: 85%;
    max-width: 300px;
    background: var(--pink-50);
    border: 1px solid var(--pink-200);
    border-radius: 0;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(200, 200, 200, 0.25);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform: scale(0.9);
    transition: transform 0.2s;
    max-height: 66%;
    overflow-y: auto;
    scrollbar-width: none;
}

.modal-box::-webkit-scrollbar {
    display: none;
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 0;
    font-size: 14px;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.btn-cancel {
    background: #f2f2f7;
    color: #555;
    border: 1px solid #ddd;
}

.btn-confirm {
    background: #333;
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-grey {
    background: var(--pink-200);
    color: var(--text-primary);
}

.btn-grey:active {
    background: #d1d1d1;
}

#modal-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    scrollbar-width: none;
}

.modal-input::-webkit-scrollbar {
    display: none;
}

.modal-input:focus {
    border-color: var(--pink-accent);
}

/* Settings Navigation Page */
.settings-nav-body {
    flex: 1;
    padding: 0 !important;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    background: var(--bg-tertiary);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings-nav-body::-webkit-scrollbar {
    display: none;
}



.settings-user-card {
    background: #fff;
    border-radius: 0;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: none;
    border-bottom: 1px solid var(--pink-200);
    cursor: pointer;
    transition: transform 0.15s;
}

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

.settings-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-user-name {
    font-size: 20px;
    font-weight: 700;
    color: #181818;
}

.settings-user-desc {
    font-size: 13px;
    color: #999;
}

.settings-user-avatar {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* 导航卡片 */
.settings-nav-card {
    background: #fff;
    border-radius: 0;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: none;
    border-bottom: 1px solid var(--pink-200);
    cursor: pointer;
    transition: transform 0.15s;
}

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

.settings-nav-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff !important;
}

.settings-nav-icon-img {
    width: 22px;
    height: 22px;
    background-color: #999 !important;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.settings-nav-text {
    flex: 1;
    min-width: 0;
}

.settings-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.settings-nav-subtitle {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.settings-nav-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Settings UI */
.settings-body {
    flex: 1;
    padding: 0 !important;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    background: var(--bg-tertiary);
}

.settings-body::-webkit-scrollbar {
    display: none;
}

.settings-section-title {
    display: block;
    font-size: 13px;
    color: #999;
    margin-left: 16px;
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.setting-group {
    background: var(--bg-card);
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    border: none;
    border-bottom: 1px solid var(--pink-200);
    overflow: hidden;
    box-shadow: none;
    flex-shrink: 0;
}

.setting-group.no-border {
    border: none;
}

.setting-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    font-size: 15px;
    color: #333;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid #f7f7f7;
}

.settings-footer {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    z-index: 10;
}

.btn-save {
    background: #333;
    color: #fff;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background 0.2s;
}

.btn-save:active {
    transform: scale(0.97);
    background: #444;
}

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

.setting-row>div {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.color-picker {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 0;
}

/* 通用输入框样式 (包括文本框、下拉框等) - 与uc-input同级美化 */
.setting-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 0;
    background-color: #ffffff;
    font-size: 14px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.setting-input:focus {
    border-color: #b0b0b0;
    box-shadow: 0 0 0 3px rgba(180, 180, 180, 0.15);
}

.setting-input::placeholder {
    color: #bbb;
}

/* 下拉框专属美化 - 与uc-select同级 */
select.setting-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 32px;
}

/* textarea 美化 */
textarea.setting-input {
    resize: vertical;
    line-height: 1.6;
}

/* 禁用状态 */
.setting-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.setting-input-sm {
    width: 50px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 0;
    text-align: center;
}

.file-upload-label {
    font-size: 12px;
    background: #f2f2f7;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s;
    appearance: none;
    color: #333;
    font-family: inherit;
}

.file-upload-label:active {
    background: #e5e5ea;
}

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

.preview-img {
    width: 32px;
    height: 32px;
    border-radius: 0;
    object-fit: cover;
    background: #eee;
    border: 1px solid #ddd;
}

.delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background-color: #c0c0c0;
    color: #fff;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.delete-btn svg {
    width: 10px;
    height: 10px;
    stroke: currentColor;
    stroke-width: 3;
}

.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #888;
    border-radius: 0;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.dark-result-item {
    border-bottom: 1px solid #333;
    padding: 10px 0;
    color: #ff69b4;
    font-family: monospace;
    animation: fadeIn 0.5s ease;
}

.dark-result-content {
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-all;
}

.dark-result-time {
    font-size: 10px;
    color: #880044;
    text-align: right;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bottom Navigation */
#bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(200, 200, 200, 0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 15;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: color 0.2s;
}

.nav-item:active {
    background-color: var(--pink-100);
}

.nav-item.active {
    color: var(--pink-500);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.nav-icon-image {
    width: 100%;
    height: 100%;
    background-color: currentColor;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.nav-label {
    font-size: 11px;
}

/* ========== User Settings & Create - 低饱和粉白风格 ========== */
.pink-header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(200, 200, 200, 0.12) !important;
}

.pink-header .header-title {
    color: var(--text-primary) !important;
}

.pink-header .header-btn svg {
    fill: var(--text-primary) !important;
}

.pink-scroll-area {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    flex: 1;
    overflow-y: auto;
    background: var(--bg-tertiary);
}

#user-settings-screen,
#character-setup-screen {
    background-color: var(--bg-primary);
}

#user-list-container,
#npc-list-container {
    padding: 0 !important;
    gap: 0 !important;
    background: var(--bg-tertiary) !important;
}

/* User Card in list */
.user-card {
    background: var(--bg-card);
    border-radius: 0;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--pink-200);
    transition: background-color 0.2s;
    animation: none;
    cursor: pointer;
}

.user-card:active {
    background-color: var(--pink-100);
}

.user-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 0;
    object-fit: cover;
    background-color: #eee;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

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

.user-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-meta {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.user-card-actions button {
    background: #f2f2f7;
    border: none;
    border-radius: 0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: background-color 0.2s;
}

.user-card-actions button:active {
    background-color: #e5e5ea;
}

.user-card-actions button.delete {
    background: #ffebee;
    color: #e53935;
}

.user-card-actions button.delete:active {
    background: #ffcdd2;
}

/* Empty state */
.user-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.user-list-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ========== User Create/Edit Screen ========== */
#npc-create-screen,
#user-create-screen {
    background-color: var(--bg-primary);
}

.user-create-body {
    background: var(--bg-primary);
}

.uc-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 10px;
}

.uc-avatar {
    width: 80px;
    height: 80px;
    border-radius: 0;
    object-fit: cover;
    background-color: #f0f0f0;
    cursor: pointer;
    border: 3px solid #ccc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.uc-avatar:active {
    transform: scale(0.93);
}

.uc-avatar-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.uc-card {
    background: #fff;
    border-radius: 0;
    padding: 16px;
    margin: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--pink-200);
}

.uc-field {
    margin-bottom: 0;
}

.uc-card .uc-field+.uc-field {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.uc-field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

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

.uc-field-header label {
    margin-bottom: 0;
}

.uc-token-count {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 0;
}

.uc-input {
    width: 100%;
    border: 1.5px solid #ddd;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.uc-input:focus {
    border-color: #b0b0b0;
    box-shadow: 0 0 0 3px rgba(180, 180, 180, 0.15);
}

.uc-input::placeholder {
    color: #bbb;
}

.uc-textarea {
    width: 100%;
    border: 1.5px solid #ddd;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.uc-textarea:focus {
    border-color: #b0b0b0;
    box-shadow: 0 0 0 3px rgba(180, 180, 180, 0.15);
}

.uc-textarea::placeholder {
    color: #bbb;
}

.uc-select {
    width: 100%;
    border: 1.5px solid #ddd;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.uc-select:focus {
    border-color: #b0b0b0;
    box-shadow: 0 0 0 3px rgba(180, 180, 180, 0.15);
}

.uc-hint {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* Gender Radio Group */
.uc-gender-group {
    display: flex;
    gap: 8px;
}

.uc-gender-option {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 0;
    border: 1.5px solid #ddd;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.uc-gender-option input[type="radio"] {
    display: none;
}

.uc-gender-option.selected {
    background: var(--accent-gradient-vivid);
    color: #fff;
    border-color: var(--pink-400);
    box-shadow: 0 2px 8px rgba(200, 200, 200, 0.3);
}

/* NPC List */
.uc-add-npc-btn {
    background: var(--accent-gradient-vivid);
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.15s;
}

.uc-add-npc-btn:active {
    transform: scale(0.95);
}

.uc-npc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uc-npc-card {
    background: #f7f7f7;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0;
    padding: 12px;
    position: relative;
}

.uc-npc-card .npc-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: #f0f0f0;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.uc-npc-card .npc-field {
    margin-bottom: 8px;
}

.uc-npc-card .npc-field:last-child {
    margin-bottom: 0;
}

.uc-npc-card .npc-field label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    font-weight: 500;
}

.uc-npc-card .npc-row {
    display: flex;
    gap: 8px;
}

.uc-npc-card .npc-row .npc-field {
    flex: 1;
}

.uc-npc-card input,
.uc-npc-card textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 0;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

.uc-npc-card input:focus,
.uc-npc-card textarea:focus {
    border-color: #b0b0b0;
}

.uc-npc-card textarea {
    resize: vertical;
    min-height: 50px;
    line-height: 1.5;
}

.uc-npc-card .npc-gender-mini {
    display: flex;
    gap: 4px;
}

.uc-npc-card .npc-gender-mini label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #555;
    padding: 4px 8px;
    border-radius: 0;
    border: 1px solid #ddd;
    cursor: pointer;
    margin-bottom: 0;
    background: #fff;
    transition: all 0.15s;
}

.uc-npc-card .npc-gender-mini label.selected {
    background: var(--accent-gradient-vivid);
    color: #fff;
    border-color: var(--pink-400);
}

.uc-npc-card .npc-gender-mini input[type="radio"] {
    display: none;
}

#user-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 0;
    object-fit: cover;
    background-color: #eee;
    cursor: pointer;
    display: block;
    margin: 0 auto 15px auto;
    border: 3px solid #ddd;
    transition: transform 0.2s;
}

#user-avatar-preview:active {
    transform: scale(0.95);
}

#user-create-modal .modal-box {
    width: 95%;
    max-width: 400px;
}

/* ========== Character Setup Screen - 统一风格 ========== */
#character-setup-screen {
    background-color: var(--bg-primary);
}

.setup-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 0;
    flex-shrink: 0;
}

.setup-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.setup-tab.active {
    color: #333;
    border-bottom-color: #333;
}

.setup-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: var(--bg-primary);
}

.setup-content {
    display: none;
    height: 100%;
    flex-direction: column;
}

.setup-content.active {
    display: flex;
}

.card-list {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    flex: 1;
    overflow-y: auto;
}

.card-list .user-card {
    background: #fff;
    border-radius: 0;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--pink-200);
    animation: none;
}

.card-list .user-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 0;
    object-fit: cover;
    background-color: #eee;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

.card-list .user-card-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.card-list .user-card-desc {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.card-list .user-card-actions {
    display: flex;
    gap: 6px;
}

.card-list .user-card-actions button {
    background: #f2f2f7;
    border: none;
    border-radius: 0;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: background-color 0.2s;
}

.card-list .user-card-actions button:active {
    background-color: #e5e5ea;
}

.card-list .user-card-actions button.delete {
    background: #ffebee;
    color: #e53935;
}

.floating-action-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 0;
    background: var(--accent-gradient-vivid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(200, 200, 200, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
}

.floating-action-button:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(200, 200, 200, 0.2);
}

.floating-action-button svg {
    width: 24px;
    height: 24px;
}

.full-page-textarea {
    flex: 1;
    width: 100%;
    border: 1.5px solid #ddd;
    border-radius: 0;
    padding: 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    line-height: 1.6;
}

.full-page-textarea:focus {
    border-color: #b0b0b0;
    box-shadow: 0 0 0 3px rgba(180, 180, 180, 0.15);
}

/* ========== Character Editor Screen - 统一风格 ========== */
#character-editor-screen {
    background-color: var(--bg-primary);
}

.editor-body {
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.editor-body .editor-avatar-container {
    text-align: center;
    margin-bottom: 20px;
}

.editor-body .editor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 0;
    object-fit: cover;
    background-color: #eee;
    cursor: pointer;
    border: 3px solid #ddd;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

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

.editor-body .editor-field {
    margin-bottom: 16px;
}

.editor-body .editor-field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
}

.editor-body .editor-field input,
.editor-body .editor-field textarea {
    width: 100%;
    border: 1.5px solid #ddd;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.editor-body .editor-field input:focus,
.editor-body .editor-field textarea:focus {
    border-color: #b0b0b0;
    box-shadow: 0 0 0 3px rgba(180, 180, 180, 0.15);
}

.editor-body .editor-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ========== User Selector Bar (横向全宽 chip 选择) ========== */
.user-selector-bar-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}

.user-selector-bar-wrapper::-webkit-scrollbar {
    display: none;
}

.user-selector-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
    border-radius: 0;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.user-selector-chip:active {
    transform: scale(0.96);
}

.user-selector-chip.selected {
    background: linear-gradient(135deg, rgba(240, 184, 194, 0.2), rgba(248, 213, 220, 0.3));
    border-color: var(--pink-400);
    box-shadow: 0 2px 8px rgba(200, 200, 200, 0.2);
}

.user-selector-chip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 0;
    object-fit: cover;
    background-color: #eee;
    border: 1.5px solid transparent;
    flex-shrink: 0;
}

.user-selector-chip.selected .user-selector-chip-avatar {
    border-color: #999;
}

.user-selector-chip-name {
    font-size: 13px;
    color: #666;
}

.user-selector-chip.selected .user-selector-chip-name {
    color: #333;
    font-weight: 600;
}

.user-selector-empty {
    width: 100%;
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 13px;
}

/* ========== Avatar Settings - 双人头像展示 ========== */
.avatar-pair-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    padding: 16px 10px;
}

.avatar-pair-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.avatar-pair-img {
    width: 56px;
    height: 56px;
    border-radius: 0;
    object-fit: cover;
    background-color: #eee;
    border: 2.5px solid #ddd;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s;
}

.avatar-pair-img:active {
    transform: scale(0.93);
}

.avatar-pair-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Action Popup (WeChat Style) */
.action-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 10000;
    display: none;
}

.action-sheet-overlay.show {
    display: block;
}

.action-popup {
    position: absolute;
    top: 70px;
    /* Below header */
    right: 10px;
    background: var(--pink-50);
    border: 1px solid var(--pink-200);
    border-radius: 0;
    padding: 5px;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(200, 200, 200, 0.2);
    transform: scale(0.9);
    opacity: 0;
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    min-width: 140px;
}

.action-popup.show {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Removed arrow */

/* Cute Toast Notification */
.cute-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--pink-50);
    color: var(--pink-600);
    padding: 12px 24px;
    border-radius: 0;
    box-shadow: 0 5px 20px rgba(200, 200, 200, 0.25);
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--pink-300);
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.cute-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.action-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 182, 193, 0.3);
    transition: background 0.2s;
}

.action-popup-item:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.action-popup-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.action-popup-item:active {
    background: rgba(255, 182, 193, 0.2);
}

.action-popup-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-popup-icon svg {
    width: 100%;
    height: 100%;
    fill: #333;
}

/* Action Sheet Styles */
.action-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

.action-sheet-overlay.active {
    display: flex;
    opacity: 1;
}

.action-sheet {
    width: 100%;
    background: #fff;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    padding-bottom: 20px;
}

.action-sheet-overlay.active .action-sheet {
    transform: translateY(0);
}

.action-sheet-item {
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    text-align: center;
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

.action-sheet-item:last-child {
    border-bottom: none;
    border-top: 5px solid #f5f5f5;
}

.action-sheet-item:active {
    background-color: #f0f0f0;
}

/* ========== 聊天创建弹窗 - 淡粉白色柔和风格 ========== */
.group-modal-cute {
    background: #ffffff;
    border-radius: 0;
    padding: 20px 18px;
    width: 85%;
    max-width: 330px;
    border: 1px solid rgba(255, 200, 210, 0.35);
    box-shadow: 0 8px 28px rgba(200, 150, 170, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: groupModalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes groupModalPop {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(8px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.group-modal-title {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.group-modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.group-modal-label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.group-modal-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.group-modal-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 0;
    border: 1px solid #ddd;
    background: #fff;
    outline: none;
    font-size: 13px;
    color: #555;
    box-sizing: border-box;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.group-modal-input::placeholder {
    color: #aaa;
    font-size: 12px;
}

.group-modal-input:focus {
    border-color: #555;
    box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.15);
}

.group-modal-select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 0;
    border: 1px solid #ddd;
    background: #fff;
    outline: none;
    font-size: 13px;
    color: #555;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23888888'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.group-modal-select:focus {
    border-color: #555;
    box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.15);
}

/* 添加角色按钮 */
.group-add-role-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 0;
    border: 1px dashed #ccc;
    background: #f9f9f9;
    color: #555;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.group-add-role-btn:hover {
    background: #f0f0f0;
    border-color: #aaa;
}

.group-add-role-btn:active {
    transform: scale(0.95);
}

.group-add-role-btn svg {
    flex-shrink: 0;
}

/* 角色下拉框列表区域 */
.group-npc-select-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    max-height: 140px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.group-npc-select-list::-webkit-scrollbar {
    display: none;
}

/* 每一行角色选择 */
.group-npc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: npcRowSlideIn 0.2s ease;
}

@keyframes npcRowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.group-npc-row select {
    flex: 1;
    padding: 7px 10px;
    border-radius: 0;
    border: 1px solid #ddd;
    background: #fff;
    outline: none;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23888888'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.group-npc-row select:focus {
    border-color: #555;
    box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.12);
}

/* 删除角色按钮 */
.group-npc-remove-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.group-npc-remove-btn:hover {
    background: #e0e0e0;
}

.group-npc-remove-btn:active {
    transform: scale(0.9);
}

/* 弹窗底部按钮美化 */
.group-modal-cancel {
    flex: 1;
    padding: 9px 0;
    border-radius: 0;
    background: #f2f2f7;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.group-modal-cancel:active {
    background: #e5e5ea;
}

.group-modal-confirm {
    flex: 1;
    padding: 9px 0;
    border-radius: 0;
    background: #333;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.group-modal-confirm:active {
    transform: scale(0.97);
    background: #444;
}

/* 空状态提示 */
.group-npc-empty-hint {
    text-align: center;
    color: #888;
    font-size: 11px;
    padding: 10px 0;
    border: 1px dashed #ddd;
    border-radius: 0;
    background: #f9f9f9;
}

/* ==============================
   World Book Styles
   ============================== */
.wb-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 0;
    margin: 0;
    padding: 12px 15px;
    box-shadow: none;
    border-bottom: 1px solid var(--pink-200);
}

.wb-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.wb-card-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.wb-card-text {
    min-width: 0;
}

.wb-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-card-sub {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.wb-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.wb-card-edit,
.wb-card-delete {
    border: none;
    border-radius: 0;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}

.wb-card-edit {
    background: #555;
    color: #fff;
}

.wb-card-delete {
    background: #f5f5f5;
    color: #e74c3c;
}

.wb-entry-card {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 0;
    padding: 14px;
    margin-top: 10px;
}

.wb-entry-card.disabled .wb-entry-field:not(.wb-entry-enable-field) {
    display: none !important;
}

.wb-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wb-entry-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.wb-entry-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.wb-entry-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.wb-entry-field:last-child {
    margin-bottom: 0;
}

.wb-entry-field>label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.wb-entry-field select,
.wb-entry-field input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 13px;
    background: #fff;
    color: #333;
    outline: none;
}

.wb-entry-content {
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 13px;
    background: #fff;
    color: #333;
    resize: vertical;
    font-family: sans-serif;
    outline: none;
}

.wb-trigger-group {
    display: flex;
    gap: 8px;
}

.wb-trigger-option {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.wb-trigger-option input[type="radio"] {
    display: none;
}

.wb-trigger-option.selected {
    background: #555;
    color: #fff;
    border-color: transparent;
}

.uc-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Quote/Reply Styles */
.msg-quote {
    margin-top: 8px;
    padding: 8px 10px;
    background-color: rgba(0, 0, 0, 0.08);
    /* Light gray overlay, works on both white and colored bubbles */
    border-radius: 0;
    font-size: 13px;
    color: inherit;
    /* Inherit text color from bubble */
    display: flex;
    flex-direction: column;
    text-align: left;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

.msg-quote-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msg-quote-header {
    display: flex;
    align-items: center;
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.msg-quote-name {
    font-weight: 600;
}

.msg-quote-name::after {
    content: "：";
}

.msg-quote-text {
    opacity: 0.85;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Limit lines if needed, but for now show full quote */
    white-space: pre-wrap;
    word-break: break-all;
}

/* Chat Settings Sub-screens */
#chat-beautify-screen,
#chat-memory-screen {
    z-index: 25;
    background-color: var(--bg-primary);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
}

/* Token Stats specific styles */
#token-total {
    font-family: 'Consolas', monospace;
}

/* Removed header overlap override */

/* Regex Screen */
#regex-screen {
    background-color: var(--bg-tertiary);
}

.regex-rule-card {
    background: var(--bg-card);
    border-radius: 0;
    padding: 14px 16px;
    margin: 0;
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-left: none;
    border-right: none;
    border-top: none;
    animation: none;
}

/* User settings toggle grayscale format */
.regex-custom-toggle input:checked+.slider {
    background-color: #333 !important;
}

.regex-custom-toggle input:checked+.slider:before {
    background-color: #fff !important;
}

.regex-custom-toggle .slider {
    background-color: #ccc !important;
}

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

.regex-rule-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.regex-rule-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    margin-left: 10px;
    flex-shrink: 0;
}

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

.regex-rule-toggle .slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 11px;
    cursor: pointer;
    transition: 0.3s;
}

.regex-rule-toggle .slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.regex-rule-toggle input:checked+.slider {
    background: #555;
}

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

.regex-rule-detail {
    display: none;
}

.regex-rule-tags {
    display: none;
}

.regex-rule-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 0;
    background: #f0f0f0;
    color: #666;
}

.regex-rule-tag.active {
    background: #e3f2fd;
    color: #1976d2;
}

.regex-rule-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.regex-rule-actions button {
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0;
    transition: 0.15s;
}

.regex-rule-actions .regex-btn-edit {
    color: #1976d2;
}

.regex-rule-actions .regex-btn-edit:active {
    background: #e3f2fd;
}

.regex-rule-actions .regex-btn-delete {
    color: #e53935;
}

.regex-rule-actions .regex-btn-delete:active {
    background: #f0f0f0;
}

.regex-empty-hint {
    box-sizing: border-box;
}

.msg-quote-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msg-quote-header {
    display: flex;
    align-items: center;
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.msg-quote-name {
    font-weight: 600;
}

.msg-quote-name::after {
    content: "：";
}

.msg-quote-text {
    opacity: 0.85;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Limit lines if needed, but for now show full quote */
    white-space: pre-wrap;
    word-break: break-all;
}

/* Chat Settings Sub-screens */
#chat-beautify-screen,
#chat-memory-screen {
    z-index: 25;
    background-color: var(--bg-primary);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
}

/* Token Stats specific styles */
#token-total {
    font-family: 'Consolas', monospace;
}

/* Removed header overlap override */

.regex-empty-hint {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
    font-size: 14px;
    line-height: 1.8;
}

/* Quote Preview Bar */
#quote-preview-bar {
    display: none;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    margin: 0 10px 0 10px;
    border-radius: 0;
}

#quote-preview-bar.visible {
    display: flex;
}

.quote-preview-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quote-preview-name {
    font-weight: bold;
    color: #333;
    font-size: 12px;
}

.quote-preview-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    opacity: 0.8;
}

.quote-preview-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.05);
    color: #999;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    flex-shrink: 0;
}

.quote-preview-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #ff6b6b;
}

/* Dark Mode Adaptation */
@media (prefers-color-scheme: dark) {
    #quote-preview-bar {
        background: rgba(40, 40, 40, 0.85);
        color: #aaa;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .quote-preview-name {
        color: #ddd;
    }

    .quote-preview-close {
        background: rgba(255, 255, 255, 0.1);
        color: #bbb;
    }
}

/* 通讯录样式 */
.contacts-section-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--pink-200);
    background: white;
    cursor: pointer;
}

.contacts-section-item:hover {
    background: var(--pink-50);
}

.contacts-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contacts-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: var(--pink-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contacts-icon-image {
    width: 24px;
    height: 24px;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    background: white;
}

.contacts-item-name {
    font-size: 16px;
    color: var(--text-primary);
}

.contacts-item-count {
    font-size: 14px;
    color: var(--text-muted);
}

.contacts-arrow {
    font-size: 14px;
    color: var(--pink-300);
}

.red-dot {
    width: 8px;
    height: 8px;
    background: var(--pink-500);
    border-radius: 0;
    margin-left: 8px;
}

.contacts-separator {
    height: 8px;
    background: var(--pink-50);
}

.contacts-index-header {
    padding: 6px 20px;
    background: var(--pink-50);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: bold;
}

.contacts-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: var(--bg-card);
    cursor: pointer;
}

.contacts-contact-item:hover {
    background: #f5f5f5;
}

.contacts-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0;
    object-fit: cover;
}

.contacts-contact-name {
    flex: 1;
    margin-left: 12px;
    font-size: 16px;
    color: #333;
}

/* 好友申请及群聊列表 modal-body 统一样式 */
.friend-requests-modal .modal-body,
.groups-list-modal .modal-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.friend-request-item {
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--pink-200);
    border-radius: 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(200, 200, 200, 0.1);
}

.friend-request-item:last-child {
    margin-bottom: 0;
}

.friend-request-info {
    margin-bottom: 12px;
}

.friend-request-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.friend-request-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.friend-request-time {
    font-size: 12px;
    color: var(--text-muted);
}

.friend-request-actions {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.btn-accept,
.btn-reject {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.btn-accept {
    background: var(--accent-gradient-vivid);
    color: white;
    box-shadow: 0 2px 8px rgba(200, 200, 200, 0.3);
}

.btn-reject {
    background: var(--pink-200);
    color: var(--text-primary);
}

.no-requests {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.modal-content.friend-requests-modal,
.modal-content.groups-list-modal {
    background: var(--pink-50);
    border: 1px solid var(--pink-200);
    border-radius: 0;
    width: 85%;
    max-width: 320px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(200, 200, 200, 0.25);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--pink-200);
}

.modal-header .modal-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: none;
    margin: 0;
    padding: 0;
}

.modal-close {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

/* 群聊列表单项卡片化 */
.group-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--pink-200);
    border-radius: 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(200, 200, 200, 0.1);
    cursor: pointer;
}

.group-list-item:last-child {
    margin-bottom: 0;
}

.group-list-item:hover {
    background: var(--pink-100);
}

.group-list-info {
    flex: 1;
}

.group-list-name {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.group-list-members {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== MiniMax TTS Styles ===== */
#tts-settings-screen {
    z-index: 15;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    background-color: var(--bg-primary);
}

/* TTS Play Button - inline at end of bubble text */
.tts-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 0;
    background: rgba(128, 128, 128, 0.12);
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    margin-left: 3px;
    flex-shrink: 0;
    border: none;
    outline: none;
    vertical-align: middle;
}

.tts-play-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

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

.tts-play-btn.playing {
    opacity: 1;
}

/* TTS Loading Spinner */
@keyframes ttsSpinnerRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.tts-loading-spinner {
    animation: ttsSpinnerRotate 1s linear infinite;
}

/* Photo and Video Card (Media Preview) */
.photo-card {
    border-radius: 0;
    overflow: hidden;
    max-width: 240px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-card img {
    max-width: 100%;
    border-radius: 0;
    display: block;
}

/* Image Description / Placeholder */
.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.photo-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.photo-placeholder-text {
    font-size: 13px;
    color: inherit;
    opacity: 0.85;
    text-align: left;
    line-height: 1.4;
    word-break: break-all;
    max-height: 180px;
    /* limits text height to enable scrolling for very long descriptions */
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
}

.photo-placeholder-text::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* ================================================================
   朋友圈 / Moments Feature
   ================================================================ */

/* Cover / Banner Area */
.moments-cover {
    position: relative;
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, var(--pink-200) 0%, var(--pink-400) 100%);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
}

.moments-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
}

.moments-cover-user {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 2;
}

.moments-cover-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
}

.moments-cover-avatar {
    width: 56px;
    height: 56px;
    border-radius: 0;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Top Actions Container */
.moments-top-actions {
    position: absolute;
    top: 42px;
    /* Adjusted to align with typical app-header buttons */
    right: 12px;
    display: flex;
    gap: 10px;
    z-index: 3;
}

/* Back Button on Cover */
.moments-back-btn {
    position: absolute;
    top: 42px;
    /* Aligned with standard header */
    left: 12px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: transform 0.15s;
}

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

.moments-back-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Compose Button (camera icon on cover) */
.moments-compose-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

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

.moments-compose-btn svg {
    width: 16px;
    height: 16px;
    fill: #fff;
    stroke: #fff;
    stroke-width: 0.5;
}

/* Post Feed Container */
.moments-feed {
    padding: 0 12px 80px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual Post */
.moment-post {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    animation: momentFadeIn 0.35s ease-out;
}

@keyframes momentFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.moment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
    cursor: pointer;
}

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

.moment-author {
    font-size: 15px;
    font-weight: 600;
    color: #576b95;
    margin-bottom: 4px;
    cursor: pointer;
}

.moment-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 6px;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Image Grid */
.moment-images {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
    max-width: 260px;
}

.moment-images.grid-1 {
    grid-template-columns: 1fr;
    max-width: 200px;
}

.moment-images.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.moment-images.grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.moment-images.grid-4 {
    grid-template-columns: 1fr 1fr;
}

.moment-images.grid-5,
.moment-images.grid-6 {
    grid-template-columns: 1fr 1fr 1fr;
}

.moment-images.grid-7,
.moment-images.grid-8,
.moment-images.grid-9 {
    grid-template-columns: 1fr 1fr 1fr;
}

.moment-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
    transition: opacity 0.15s;
    background: #f0f0f0;
}

.moment-img:active {
    opacity: 0.8;
}

.moment-img-text {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    box-sizing: border-box;
    background: #f0f0f0;
    border-radius: 0;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    word-break: break-all;
    white-space: pre-wrap;
    transition: background 0.15s;
}

.moment-img-text:active {
    background: #e4e4e4;
}

/* Post Footer (time + actions) */
.moment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.moment-time {
    font-size: 12px;
    color: var(--text-muted);
}

.moment-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.moment-action-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

.moment-action-btn svg {
    width: 16px;
    height: 16px;
    fill: #999;
}

/* Action Popup (Like + Comment buttons) */
.moment-action-popup {
    display: none;
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--pink-50);
    border: 1px solid var(--pink-200);
    border-radius: 0;
    overflow: hidden;
    flex-direction: row;
    min-width: 280px;
    box-shadow: 0 2px 12px rgba(200, 200, 200, 0.3);
    animation: popupSlideIn 0.2s ease;
    z-index: 10;
}

.moment-action-popup.show {
    display: flex;
}

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

    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.moment-popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 0;
    flex: 1;
    color: var(--pink-600);
    font-size: 13px;
    cursor: pointer;
    border: none;
    background: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.moment-popup-btn:active {
    background: var(--pink-100);
}

.moment-popup-btn+.moment-popup-btn {
    border-left: 1px solid var(--pink-200);
}

.moment-popup-btn svg {
    width: 14px;
    height: 14px;
    fill: var(--pink-600);
}

.interactor-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    background: #ccc;
    color: #fff;
    font-size: 10px;
    padding: 0 4px;
    margin-left: 2px;
}

/* Likes Section */
.moment-likes {
    background: #f7f7f7;
    border-radius: 0;
    padding: 6px 10px;
    margin-top: 6px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 13px;
    color: #576b95;
    line-height: 1.5;
}

.moment-likes svg {
    width: 14px;
    height: 14px;
    fill: #e53935;
    flex-shrink: 0;
    margin-top: 2px;
}

.moment-likes-names {
    word-break: break-word;
}

.moment-likes-names span {
    font-weight: 500;
    cursor: pointer;
}

.moment-likes-names span+span::before {
    content: ', ';
    color: #999;
    font-weight: normal;
}

/* Comments Section */
.moment-comments {
    background: #f7f7f7;
    border-radius: 0;
    padding: 0 10px;
    font-size: 13px;
    line-height: 1.5;
}

.moment-likes+.moment-comments {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 0;
}

.moment-comments:not(:empty) {
    padding: 6px 10px;
}

.moment-comment-item {
    margin-bottom: 3px;
}

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

.moment-comment-name {
    font-weight: 600;
    color: #576b95;
    cursor: pointer;
}

.moment-comment-text {
    color: var(--text-primary);
}

.moment-comment-reply-target {
    color: var(--text-muted);
    margin: 0 2px;
}

/* Comment Input Area (appears at bottom when commenting) */
.moment-comment-input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 8px 12px;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 100;
    animation: slideUpBar 0.2s ease;
}

.moment-comment-input-bar.show {
    display: flex;
}

@keyframes slideUpBar {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.moment-comment-input-bar input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    background: #f7f7f7;
    font-family: inherit;
}

.moment-comment-input-bar input:focus {
    border-color: var(--pink-400);
    background: #fff;
}

.moment-comment-send-btn {
    background: var(--accent-gradient-vivid);
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s;
}

.moment-comment-send-btn:active {
    transform: scale(0.95);
}

/* ====== Compose Moments Modal ====== */
.moments-compose-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.moments-compose-overlay.show {
    display: flex;
}

.moments-compose-panel {
    width: 100%;
    max-height: 85vh;
    background: #fff;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    animation: slideUpPanel 0.3s ease;
    overflow: hidden;
}

@keyframes slideUpPanel {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.compose-cancel {
    font-size: 13px;
    color: #555;
    cursor: pointer;
    background: #f2f2f7;
    border: 1px solid #ddd;
    padding: 9px 14px;
    font-weight: 600;
    border-radius: 0;
    font-family: inherit;
}

.compose-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.compose-publish {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.compose-cancel:active {
    transform: scale(0.97);
    background: #e5e5ea;
}

.compose-publish:active {
    transform: scale(0.97);
    background: #444;
}

.compose-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.compose-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
}

.compose-textarea::placeholder {
    color: #bbb;
}

.compose-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.compose-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.compose-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compose-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.compose-add-image {
    aspect-ratio: 1;
    border-radius: 0;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
}

.compose-add-image:active {
    background: #f0f0f0;
    border-color: #bbb;
}

.compose-add-image svg {
    width: 28px;
    height: 28px;
    stroke: #ccc;
    fill: none;
    stroke-width: 2;
}

/* Compose footer tools */
.compose-tools {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}

.compose-tool-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    border-radius: 0;
    transition: background 0.15s;
}

.compose-tool-btn:active {
    background: #f0f0f0;
}

.compose-tool-btn svg {
    width: 22px;
    height: 22px;
    fill: #999;
    stroke: #999;
    stroke-width: 0.5;
}

/* Delete post button */
.moment-delete-btn {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    margin-left: 12px;
    transition: color 0.2s;
}

.moment-delete-btn:active {
    color: #e53935;
}

/* Action area wrapper (for positioning popup) */
.moment-action-area {
    position: relative;
    display: flex;
    align-items: center;
}

/* Empty Moments */
.moments-empty {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
    font-size: 14px;
}

.moments-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Full-screen image viewer */
.moment-image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.moment-image-viewer.show {
    display: flex;
}

.moment-image-viewer img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0;
}

/* Moments Empty State */
.moments-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
    gap: 12px;
}

.moments-empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

/* Cover Upload Overlay */
.moments-cover-upload-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    justify-content: center;
    align-items: flex-end;
}

.moments-cover-upload-overlay.show {
    display: flex;
}

.moments-cover-upload-sheet {
    background: #fff;
    border-radius: 0;
    width: 100%;
    max-width: 500px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideUpSheet 0.25s ease;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.cover-upload-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.cover-upload-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: none;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s;
}

.cover-upload-option:hover {
    background: #f5f5f5;
}

.cover-upload-option svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cover-upload-cancel {
    border: none;
    background: #f5f5f5;
    padding: 12px;
    border-radius: 0;
    font-size: 15px;
    color: #999;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s;
}

.cover-upload-cancel:hover {
    background: #eee;
}

/* Comment Reply Target */
.moment-comment-reply-target {
    color: #999;
    margin: 0 4px;
    font-size: 12px;
}

/* Interactor Badge on AI Reply Button */
.interactor-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 0;
    background: #07c160;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
    line-height: 1;
}

/* Interactor Picker Overlay */
.interactor-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.interactor-picker-panel {
    background: var(--pink-50);
    border: 1px solid var(--pink-200);
    border-radius: 0;
    width: 85%;
    max-width: 360px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(200, 200, 200, 0.25);
    animation: fadeScaleIn 0.2s ease;
}

@keyframes fadeScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.interactor-picker-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--pink-200);
    flex-shrink: 0;
}

.interactor-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.interactor-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.interactor-item:hover {
    background: #f8f8f8;
}

.interactor-item.selected {
    background: var(--pink-100);
}

.interactor-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--pink-500);
    cursor: pointer;
}

.interactor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 0;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.interactor-name {
    font-size: 14px;
    color: #333;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.interactor-sub-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 0;
    background: var(--pink-200, #f5d5d5);
    color: var(--pink-600, #c06070);
    font-weight: 500;
}

.interactor-picker-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--pink-200);
    flex-shrink: 0;
}

.interactor-select-all-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--pink-200);
    background: var(--pink-50);
    border-radius: 0;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.interactor-select-all-btn:hover {
    background: var(--pink-100);
}

.interactor-confirm-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: #333;
    border-radius: 0;
    font-size: 14px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.interactor-confirm-btn:hover {
    background: #444;
}

/* ================================
   Lock Screen Styles
   ================================ */

.lock-key {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    margin: 0 auto;
    font-size: 24px;
    font-weight: 300;
    color: var(--pink-600);
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.4), 0 2px 10px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.1s;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.lock-key:active {
    transform: scale(0.85);
    background-color: rgba(255, 255, 255, 0.5);
}

.lock-key-empty {
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    cursor: default;
}

.lock-delete {
    background-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    width: 50px;
    height: 50px;
}

.lock-delete:active {
    background-color: transparent !important;
}

.lock-delete svg {
    width: 24px;
    height: 24px;
    stroke: var(--pink-600);
}

.lock-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--pink-600);
    background-color: transparent;
    transition: background-color 0.15s, transform 0.15s;
    box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.5);
}

.lock-dot.filled {
    background-color: var(--pink-600);
    transform: scale(1.1);
}

@keyframes lockPulse {
    0% {
        transform: translateY(0);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-8px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 0.5;
    }
}

@keyframes keypadSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ================================
   Home Screen Edit Mode & Drag Drop
   ================================ */

@keyframes jiggle {
    0% {
        transform: rotate(-1.5deg);
    }

    50% {
        transform: rotate(1.5deg);
    }

    100% {
        transform: rotate(-1.5deg);
    }
}

body.edit-mode .app-draggable {
    animation: jiggle 0.25s infinite;
    cursor: grab;
    z-index: 5;
}

body.edit-mode .app-draggable:active {
    cursor: grabbing;
    animation: none;
    transform: scale(1.1);
}

.grid-slot {
    border-radius: 0;
    background: transparent;
    z-index: 1;
    pointer-events: none;
    /* Ignore initially */
}

body.edit-mode .grid-slot {
    pointer-events: auto;
    /* Allow hitting slots only in edit mode */
}

.grid-slot.drag-over {
    background: rgba(255, 255, 255, 0.2) !important;
}

.app-draggable.drag-over {
    opacity: 0.5;
}

.dragging-ghost .app-name {
    display: none;
    /* Hide name when moving for cleaner look */
}

.color-picker-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.color-hex-input {
    width: 55px;
    font-size: 11px;
    font-family: monospace;
    border: 1px solid #ddd;
    border-radius: 0;
    padding: 2px 4px;
    color: #555;
    background: #fff;
    text-transform: uppercase;
    outline: none;
}

.color-hex-input:focus {
    border-color: var(--pink-400);
}

/* ========== 外卖/购物 App 通用样式 ========== */
.store-app-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 800;
    background: #f5f5f7;
    flex-direction: column;
    overflow: hidden;
}

.store-app-screen.visible {
    display: flex;
    animation: screenSlideIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes screenSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0.8;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes screenSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0.8;
    }
}

/* == App Header == */
.store-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 40px;
    height: 80px;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.store-header .store-back {
    width: 32px;
    height: 32px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.store-header .store-back svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.store-header .store-title {
    font-size: 17px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    flex: 1;
    text-align: center;
}

.store-header .store-cart-btn {
    width: 32px;
    height: 32px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    position: relative;
    backdrop-filter: blur(4px);
}

.store-header .store-cart-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.store-cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ff3b30;
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

/* == Themed Headers == */
#takeout-screen .store-header {
    background: linear-gradient(135deg, #008ae6, #00b4d8);
}

#shopping-screen .store-header {
    background: linear-gradient(135deg, #ff6b6b, #ff7e67);
}

/* == Search Bar == */
.store-search {
    display: flex;
    align-items: center;
    margin: 0 16px 12px;
    background: white;
    border-radius: 0;
    padding: 0 4px 0 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    gap: 4px;
}

.store-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 10px 0;
    background: transparent;
    color: #333;
    min-width: 0;
}

.store-search input::placeholder {
    color: #bbb;
}

.store-search-btn {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

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

.store-search-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

#takeout-screen .store-search-btn {
    background: linear-gradient(135deg, #008ae6, #00b4d8);
    box-shadow: 0 2px 8px rgba(0, 138, 230, 0.3);
}

#shopping-screen .store-search-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff7e67);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* == Promotional Banner == */
.store-banner {
    margin: 0 16px 14px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.store-banner-bg {
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

#takeout-screen .store-banner-bg {
    background: linear-gradient(135deg, #008ae6, #00b4d8, #48cae4);
}

#shopping-screen .store-banner-bg {
    background: linear-gradient(135deg, #ff6b6b, #ff7e67, #ffa07a);
}

.store-banner-text {
    position: relative;
    z-index: 2;
}

.store-banner-title {
    font-size: 17px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.store-banner-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 4px;
}

.store-banner-emoji {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    opacity: 0.8;
    z-index: 1;
}

/* == Category Tabs == */
.store-categories {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.store-categories::-webkit-scrollbar {
    display: none;
}

.store-cat-btn {
    padding: 6px 16px;
    border-radius: 0;
    border: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.7);
    color: #666;
    backdrop-filter: blur(4px);
}

.store-cat-btn.active {
    background: white;
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* == Products Grid == */
.store-products {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 100px;
    -webkit-overflow-scrolling: touch;
}

.store-products::-webkit-scrollbar {
    display: none;
}

.store-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.store-product-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s;
    cursor: pointer;
}

.store-product-card:active {
    transform: scale(0.97);
}

.store-product-img {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
}

.store-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-product-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ff3b30);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 0;
    letter-spacing: 0.3px;
}

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

.store-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.store-product-desc {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.store-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #ff4500;
}

.store-product-price .currency {
    font-size: 11px;
    font-weight: 500;
}

.store-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.store-add-btn:active {
    transform: scale(0.88);
}

/* == 外卖 Header gradient == */
#takeout-screen .store-header {
    background: linear-gradient(135deg, #0088ff, #00b4ff);
}

#takeout-screen .store-categories {
    background: linear-gradient(to bottom, #0099ff, transparent);
    padding-top: 4px;
}

#takeout-screen .store-add-btn {
    background: linear-gradient(135deg, #0088ff, #00b4ff);
    box-shadow: 0 3px 8px rgba(0, 136, 255, 0.3);
}

#takeout-screen .store-cat-btn.active {
    color: #0088ff;
}

/* == 购物 Header gradient == */
#shopping-screen .store-header {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
}

#shopping-screen .store-categories {
    background: linear-gradient(to bottom, #ff7b7b, transparent);
    padding-top: 4px;
}

#shopping-screen .store-add-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
}

#shopping-screen .store-cat-btn.active {
    color: #ff6b6b;
}

/* == Cart Bottom Bar == */
.store-cart-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    padding: 10px 16px;
    z-index: 10;
    gap: 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.store-cart-icon {
    width: 48px;
    height: 48px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: -20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#takeout-screen .store-cart-icon {
    background: linear-gradient(135deg, #0088ff, #00b4ff);
}

#shopping-screen .store-cart-icon {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
}

.store-cart-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.store-cart-icon .cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff3b30;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.store-cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.store-cart-total {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.store-cart-total .currency {
    font-size: 12px;
    font-weight: 500;
}

.store-cart-delivery {
    font-size: 11px;
    color: #999;
}

.store-checkout-btn {
    padding: 10px 24px;
    border-radius: 0;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
    letter-spacing: 0.3px;
}

.store-checkout-btn:active {
    transform: scale(0.96);
}

.store-checkout-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#takeout-screen .store-checkout-btn {
    background: linear-gradient(135deg, #0088ff, #00b4ff);
    box-shadow: 0 4px 12px rgba(0, 136, 255, 0.3);
}

#shopping-screen .store-checkout-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* == Cart Detail Overlay == */
.store-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 50;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}

.store-cart-overlay.visible {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.store-cart-panel {
    background: white;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    max-height: 60%;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.store-cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.store-cart-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.store-cart-clear {
    font-size: 13px;
    color: #999;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 8px;
}

.store-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

.store-cart-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f8f8f8;
    gap: 12px;
}

.store-cart-item-info {
    flex: 1;
}

.store-cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.store-cart-item-price {
    font-size: 13px;
    color: #ff4500;
    font-weight: 600;
    margin-top: 2px;
}

.store-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 0;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.15s;
}

.store-qty-btn:active {
    transform: scale(0.9);
    background: #f0f0f0;
}

.store-qty-num {
    font-size: 15px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* == Order Success Modal == */
.store-order-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.store-order-modal.visible {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.store-order-box {
    background: white;
    border-radius: 0;
    padding: 30px 24px;
    width: 85%;
    max-width: 300px;
    text-align: center;
    animation: modalPop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

@keyframes modalPop {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.store-order-icon {
    width: 64px;
    height: 64px;
    border-radius: 0;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

#takeout-screen .store-order-icon {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

#shopping-screen .store-order-icon {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
}

.store-order-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.store-order-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.5;
    margin-bottom: 6px;
}

.store-order-items-summary {
    font-size: 12px;
    color: #666;
    text-align: left;
    background: #f8f8f8;
    padding: 10px 14px;
    border-radius: 0;
    margin: 12px 0;
    max-height: 80px;
    overflow-y: auto;
    line-height: 1.6;
}

.store-order-total {
    font-size: 22px;
    font-weight: 700;
    color: #ff4500;
    margin: 8px 0 16px;
}

.store-order-total .currency {
    font-size: 13px;
}

.store-order-btns {
    display: flex;
    gap: 10px;
}

.store-order-btn {
    flex: 1;
    padding: 9px 14px;
    border-radius: 0;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.store-order-btn:active {
    transform: scale(0.97);
}

.store-order-btn.primary {
    background: #333;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#takeout-screen .store-order-btn.primary {
    background: #333;
}

#shopping-screen .store-order-btn.primary {
    background: #333;
}

.store-order-btn.secondary {
    background: #f2f2f7;
    color: #555;
    border: 1px solid #ddd;
}

/* == Empty Cart == */
.store-empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}

.store-empty-cart-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.store-empty-cart-text {
    font-size: 14px;
    color: #bbb;
}

/* == Search bar in store == */
.store-search {
    margin: 0 16px 10px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
}

.store-search input {
    border: none;
    background: none;
    flex: 1;
    font-size: 13px;
    color: #333;
    outline: none;
}

.store-search input::placeholder {
    color: #bbb;
}

.store-search svg {
    width: 16px;
    height: 16px;
    fill: #ccc;
    flex-shrink: 0;
}

/* == Banner in store == */
.store-banner {
    margin: 0 16px 12px;
    border-radius: 0;
    overflow: hidden;
    height: 100px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.store-banner-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

#takeout-screen .store-banner-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 40%, #0088ff 100%);
}

#shopping-screen .store-banner-bg {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.store-banner-text {
    color: white;
}

.store-banner-title {
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    margin-bottom: 4px;
}

.store-banner-subtitle {
    font-size: 12px;
    opacity: 0.85;
}

.store-banner-emoji {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Add to cart animation */
@keyframes addBounce {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.cart-bounce {
    animation: addBounce 0.3s ease;
}

/* == Search Loading Spinner == */
.store-search-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 0;
    animation: storeSpinAnim 0.6s linear infinite;
    flex-shrink: 0;
    margin-right: 8px;
    display: none;
}

.store-search-spinner.active {
    display: block;
}

#takeout-screen .store-search-spinner {
    border-top-color: #008ae6;
}

#shopping-screen .store-search-spinner {
    border-top-color: #ff6b6b;
}

@keyframes storeSpinAnim {
    to {
        transform: rotate(360deg);
    }
}

/* == Order / Checkout Modal == */
.store-order-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 900;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.store-order-modal.visible {
    display: flex;
}

.store-order-box {
    background: white;
    border-radius: 0;
    padding: 28px 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    animation: modalPopIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalPopIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.store-order-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.store-order-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.store-order-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.store-order-items-summary {
    background: #f8f8f8;
    border-radius: 0;
    padding: 12px 14px;
    font-size: 12px;
    color: #666;
    text-align: left;
    white-space: pre-line;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 12px;
    line-height: 1.6;
}

.store-order-total {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 12px 0 16px;
}

.store-order-total .currency {
    font-size: 16px;
    margin-right: 2px;
}

.store-order-btns {
    display: flex;
    gap: 10px;
}

.store-order-btn {
    flex: 1;
    padding: 9px 14px;
    border-radius: 0;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.store-order-btn:active {
    transform: scale(0.97);
}

.store-order-btn.secondary {
    background: #f2f2f7;
    color: #555;
    border: 1px solid #ddd;
}

.store-order-btn.primary {
    background: #333;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#takeout-screen .store-order-btn.primary,
#takeout-order-modal .store-order-btn.primary {
    background: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#shopping-screen .store-order-btn.primary,
#shopping-order-modal .store-order-btn.primary {
    background: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.store-order-btn.friend-pay {
    width: 100%;
    margin-top: 10px;
    padding: 9px 14px;
    border-radius: 0;
    border: 1px solid #ddd;
    background: #f2f2f7;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.store-order-btn.friend-pay:active {
    transform: scale(0.97);
    background: #e5e5ea;
}

/* ========== FORUM (星海社区) ========== */
.forum-screen {
    background: #f7f8fa;
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.forum-header {
    height: 80px;
    padding-top: 40px;
    padding-left: 15px;
    padding-right: 15px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(200, 200, 200, 0.12);
    z-index: 10;
    box-sizing: border-box;
}

.forum-back-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 6px;
}

.forum-back-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.forum-back-btn:active {
    opacity: 0.5;
}

.forum-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.forum-header-actions {
    display: flex;
    gap: 2px;
}

.forum-header-icon-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    padding: 6px;
}

.forum-header-icon-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.forum-header-icon-btn:active {
    opacity: 0.5;
}

/* Search Bar */
.forum-search-bar {
    background: #fff;
    padding: 0 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    flex-shrink: 0;
    border-bottom: 0.5px solid #e8e8e8;
}

.forum-search-bar.show {
    max-height: 50px;
    padding: 6px 12px 8px;
}

.forum-search-inner {
    display: flex;
    align-items: center;
    background: #f2f3f5;
    border-radius: 0;
    padding: 0 10px;
    gap: 6px;
}

.forum-search-icon {
    width: 16px;
    height: 16px;
    fill: #b0b0b0;
    flex-shrink: 0;
}

.forum-search-inner input {
    flex: 1;
    border: none;
    background: transparent;
    height: 34px;
    font-size: 13.5px;
    outline: none;
    color: #333;
}

.forum-search-inner input::placeholder {
    color: #b0b0b0;
}

.forum-search-clear {
    border: none;
    background: none;
    color: #b0b0b0;
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.forum-search-go-btn {
    border: none;
    background: #1d1d1f;
    color: #fff;
    border-radius: 0;
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.forum-search-go-btn:active {
    opacity: 0.6;
}

.forum-search-go-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Section Tabs */
.forum-tabs {
    background: #fff;
    display: flex;
    gap: 0;
    padding: 0 4px;
    border-bottom: 0.5px solid #e8e8e8;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.forum-tabs::-webkit-scrollbar {
    display: none;
}

.forum-tab {
    padding: 9px 11px;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: color 0.15s;
    flex-shrink: 0;
    background: none;
    border: none;
}

.forum-tab-icon {
    font-size: 12px;
    display: none;
}

.forum-tab-label {
    font-weight: 500;
}

.forum-tab.active {
    color: #1d1d1f;
    font-weight: 600;
}

.forum-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: #1d1d1f;
    border-radius: 0;
}

/* Section Header */
.forum-section-header {
    background: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid #e8e8e8;
    flex-shrink: 0;
}

.forum-section-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum-section-icon {
    font-size: 14px;
    color: #999;
}

.forum-section-meta {
    display: flex;
    flex-direction: column;
}

.forum-section-name {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
}

.forum-section-desc {
    font-size: 11.5px;
    color: #aaa;
    margin-top: 1px;
}

.forum-section-stats {
    font-size: 11.5px;
    color: #bbb;
}

/* Feed */
.forum-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Empty State */
.forum-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.forum-empty-icon {
    font-size: 28px;
    margin-bottom: 10px;
    color: #ccc;
}

.forum-empty-text {
    font-size: 14px;
    margin-bottom: 4px;
    color: #999;
}

.forum-empty-hint {
    font-size: 12px;
    color: #c0c0c0;
}

/* Post Card */
.forum-card {
    background: #fff;
    padding: 13px 14px;
    border-bottom: 0.5px solid #efefef;
    transition: background 0.1s;
}

.forum-card:active {
    background: #f9f9f9;
}

.forum-card.pinned {
    border-left: 2px solid #7a8baa;
}

.forum-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.forum-avatar {
    width: 32px;
    height: 32px;
    border-radius: 0;
    object-fit: cover;
    margin-right: 9px;
}

.forum-author-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.forum-author-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.forum-author-level {
    font-size: 9px;
    background: #eef0f4;
    color: #7a8baa;
    padding: 1px 5px;
    border-radius: 0;
    font-weight: 600;
}

.forum-author-time {
    font-size: 11px;
    color: #b0b0b0;
    margin-top: 1px;
}

.forum-section-badge {
    font-size: 9.5px;
    background: #f0f1f5;
    color: #8892a8;
    padding: 1px 5px;
    border-radius: 0;
    font-weight: 500;
}

.forum-pinned-badge {
    font-size: 11px;
    color: #7a8baa;
    margin-bottom: 4px;
    font-weight: 500;
    display: block;
}

.forum-more-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    color: #ccc;
}

.forum-more-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.forum-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 3px;
    line-height: 1.35;
}

.forum-card-text {
    font-size: 13.5px;
    color: #666;
    line-height: 1.45;
    margin-bottom: 6px;
    word-break: break-word;
}

.forum-card-text.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags */
.forum-card-tags,
.forum-detail-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.forum-tag {
    font-size: 10.5px;
    color: #7a8baa;
    background: #f0f1f5;
    padding: 2px 7px;
    border-radius: 0;
    font-weight: 500;
}

/* Images */
.forum-card-images {
    margin-bottom: 8px;
    border-radius: 0;
    overflow: hidden;
}

.forum-card-images.single {}

.forum-card-images.row {
    display: flex;
    gap: 3px;
}

.forum-card-images.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
}

.forum-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
}

.forum-card-images.single .forum-img {
    height: auto;
    max-height: 200px;
    width: 100%;
}

.forum-card-images.row .forum-img {
    flex: 1;
    min-width: 0;
}

.forum-txt-img {
    height: 110px;
    min-width: 90px;
    background: #f5f6f8;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    padding: 8px;
    text-align: center;
    border: 0.5px solid #e8e8e8;
    flex-shrink: 0;
}

/* Card Footer */
.forum-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px;
}

.forum-card-stats {
    display: flex;
    gap: 10px;
}

.forum-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    color: #bbb;
}

.forum-stat svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.forum-footer-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
}

.forum-footer-btn:active {
    opacity: 0.5;
}

.forum-footer-btn svg {
    width: 16px;
    height: 16px;
}

.forum-footer-btn.liked {
    color: #e06070;
}

/* FAB */
.forum-fab {
    position: absolute;
    bottom: 28px;
    right: 18px;
    width: 46px;
    height: 46px;
    background: #1d1d1f;
    color: #fff;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 20;
    transition: transform 0.15s;
}

.forum-fab svg {
    width: 20px;
    height: 20px;
}

.forum-fab:active {
    transform: scale(0.9);
}

/* ---- Detail View ---- */
.forum-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 1001;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.forum-detail-overlay.show {
    display: flex;
}

.forum-detail-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 60px;
}

.forum-detail-post {
    padding: 14px;
    border-bottom: 6px solid #f7f8fa;
}

.forum-detail-header {}

.forum-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 12px 0 6px;
    line-height: 1.35;
}

.forum-detail-text {
    font-size: 14.5px;
    color: #444;
    line-height: 1.65;
    margin-bottom: 10px;
    word-break: break-word;
}

.forum-detail-images {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.forum-detail-img {
    width: 100%;
    border-radius: 0;
    cursor: pointer;
}

/* Detail Actions */
.forum-detail-actions {
    display: flex;
    gap: 6px;
    padding: 10px 0;
    border-top: 0.5px solid #efefef;
    margin-top: 10px;
    flex-wrap: wrap;
}

.forum-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    background: #f5f6f8;
    border: none;
    color: #777;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 0;
    transition: background 0.1s;
}

.forum-action-btn:active {
    background: #eee;
}

.forum-action-btn svg {
    width: 14px;
    height: 14px;
}

.forum-action-btn.liked {
    color: #e06070;
    background: #fdf2f3;
}

.forum-action-btn.delete {
    color: #bbb;
}

.forum-action-btn.forum-action-ai {
    margin-left: auto;
    color: #7f8ca2;
}

/* Detail Likes */
.forum-detail-likes {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 0;
    border-top: 0.5px solid #efefef;
    margin-top: 6px;
}

.forum-detail-likes svg {
    flex-shrink: 0;
}

.forum-likes-names {
    font-size: 12.5px;
    color: #7a8baa;
    font-weight: 500;
    line-height: 1.4;
}

/* Comments */
.forum-comments-title {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    padding: 12px 14px 5px;
}

.forum-empty-comments {
    text-align: center;
    padding: 36px;
    color: #ccc;
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.forum-comment-item {
    padding: 10px 14px;
    border-bottom: 0.5px solid #f2f3f5;
    display: flex;
    gap: 8px;
    cursor: pointer;
    transition: background 0.1s;
}

.forum-comment-item:active {
    background: #fafafa;
}

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

.forum-comment-body {
    flex: 1;
    min-width: 0;
}

.forum-comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.forum-comment-name {
    font-size: 12.5px;
    color: #7a8baa;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.forum-host-badge {
    font-size: 9px;
    color: #e06070;
    border: 0.5px solid #e06070;
    padding: 0 3px;
    border-radius: 0;
    font-weight: 600;
}

.forum-comment-text {
    font-size: 13.5px;
    color: #333;
    line-height: 1.45;
    margin-bottom: 3px;
    word-break: break-word;
}

.forum-reply-target {
    color: #aaa;
    font-size: 12.5px;
    margin-right: 2px;
}

.forum-reply-name {
    color: #7a8baa;
    font-weight: 500;
}

.forum-comment-time {
    font-size: 10.5px;
    color: #c5c5c5;
}

/* Bottom Input */
.forum-bottom-input {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 50px;
    background: #fff;
    border-top: 0.5px solid #e8e8e8;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
    padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.forum-input-field {
    flex: 1;
    height: 34px;
    background: #f2f3f5;
    border: none;
    border-radius: 0;
    padding: 0 12px;
    font-size: 13.5px;
    outline: none;
    color: #333;
}

.forum-comment-anon-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #8a8a8a;
    white-space: nowrap;
    user-select: none;
}

.forum-comment-anon-toggle input {
    margin: 0;
}

.forum-send-btn {
    border: none;
    background: none;
    color: #7a8baa;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 4px;
    white-space: nowrap;
}

.forum-send-btn:disabled {
    color: #d0d0d0;
}

.forum-ai-btn {
    color: #999;
}

/* ---- Compose Modal ---- */
.forum-compose-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1002;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}

.forum-compose-overlay.show {
    display: flex;
}

.forum-compose-sheet {
    background: #fff;
    border-radius: 0;
    padding: 16px;
    height: 85%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideUpSheet 0.25s ease;
    overflow-y: auto;
}

.forum-compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.forum-compose-cancel {
    color: #555;
    background: #f2f2f7;
    border: 1px solid #ddd;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0;
    padding: 9px 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.forum-compose-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.forum-compose-publish {
    color: #fff;
    background: #333;
    border: none;
    font-size: 13px;
    padding: 9px 14px;
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.forum-compose-cancel:active {
    transform: scale(0.97);
    background: #e5e5ea;
}

.forum-compose-publish:active {
    transform: scale(0.97);
    background: #444;
}

.forum-compose-label {
    font-size: 12px;
    color: #aaa;
    font-weight: 500;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Section Picker */
.forum-compose-section-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.forum-compose-section-item {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
    border-radius: 0;
    font-size: 12.5px;
    background: #f5f6f8;
    color: #777;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.forum-compose-section-item.selected {
    background: #f0f1f5;
    color: #1d1d1f;
    border-color: #c0c5d0;
    font-weight: 600;
}

/* Tag Picker */
.forum-compose-tag-picker {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.forum-compose-tag {
    padding: 3px 10px;
    border-radius: 0;
    font-size: 11.5px;
    background: #f5f6f8;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.forum-compose-tag.selected {
    background: #f0f1f5;
    color: #1d1d1f;
    border-color: #c0c5d0;
    font-weight: 600;
}

.forum-compose-input-title {
    width: 100%;
    border: none;
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
    padding: 0;
    outline: none;
    flex-shrink: 0;
}

.forum-compose-input-title::placeholder {
    color: #ccc;
}

.forum-compose-input-text {
    flex: 1;
    width: 100%;
    border: none;
    font-size: 14.5px;
    color: #444;
    padding: 0;
    outline: none;
    resize: none;
    line-height: 1.55;
    min-height: 80px;
}

.forum-compose-input-text::placeholder {
    color: #ccc;
}

/* Compose Images */
.forum-compose-img-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 6px 0;
}

.forum-compose-img-item {
    position: relative;
    width: 68px;
    height: 68px;
}

.forum-compose-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.forum-compose-img-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.forum-compose-img-add {
    width: 68px;
    height: 68px;
    background: #f7f8fa;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 0.5px dashed #d0d0d0;
    transition: border-color 0.15s;
}

.forum-compose-img-add:hover {
    border-color: #999;
}

.forum-compose-img-add svg {
    width: 20px;
    height: 20px;
}

/* AI Loading Spinner on star button */
.forum-header-icon-btn.forum-ai-loading {
    animation: forumAISpin 1s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes forumAISpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ---- Forum Profile (My Homepage) ---- */
.forum-profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 1001;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
}

.forum-profile-overlay.show {
    display: flex;
}

.forum-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    padding-top: 40px;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 0.5px solid #e8e8e8;
    flex-shrink: 0;
}

.forum-profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 16px;
    background: linear-gradient(180deg, #f7f8fa 0%, #fff 100%);
}

.forum-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 0;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #e8e8e8;
}

.forum-profile-name {
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.forum-profile-stats {
    display: flex;
    gap: 18px;
    font-size: 12px;
    color: #888;
}

.forum-profile-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.forum-profile-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    padding: 14px 14px 6px;
    border-top: 6px solid #f7f8fa;
}

.forum-profile-posts {
    flex: 1;
}

.forum-profile-post {
    padding: 12px 14px;
    border-bottom: 0.5px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s;
}

.forum-profile-post:active {
    background: #f9f9f9;
}

.forum-profile-post-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.35;
    margin-bottom: 3px;
}

.forum-profile-post-meta {
    font-size: 11px;
    color: #b0b0b0;
    margin-bottom: 4px;
}

/* ========== Range Input Styling ========== */
input[type="range"].setting-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

input[type="range"].setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #888;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ========== Worldbook Entry Switch ========== */
.wb-entry-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    vertical-align: middle;
}

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

.wb-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 4px;
}

.wb-slider::before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 4px;
}

.wb-entry-switch input:checked+.wb-slider {
    background-color: #555;
}

.wb-entry-switch input:checked+.wb-slider::before {
    transform: translateX(14px);
}

/* ========== Settings Nav Body ========== */
.settings-nav-body {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* ========== Checkbox Accent Override ========== */
input[type="checkbox"] {
    accent-color: #555;
}

/* ========== Button Pink Override ========== */
.btn-fetch-models {
    background: #555;
    color: #fff;
}

/* ========== Music Player App ========== */
.music-app {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fafafa;
    z-index: 50;
    flex-direction: column;
}

.music-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Library Header */
.music-header {
    height: 80px;
    padding-top: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 14px;
    padding-right: 14px;
    background: #fff;
    border-bottom: 0.5px solid #eee;
    flex-shrink: 0;
    box-sizing: border-box;
}

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

.music-header-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    border-radius: 50%;
    transition: background 0.15s;
}

.music-header-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

/* Play All Bar */
.music-play-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 0.5px solid #f0f0f0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.music-play-all:active {
    background: #f8f8f8;
}

.music-play-all svg {
    color: #e74c3c;
}

.music-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

/* Song List */
.music-song-list {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

.music-song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.music-song-item:active {
    background: #f5f5f5;
}

.music-song-item.active {
    background: rgba(231, 76, 60, 0.05);
}

.music-song-item.active .music-song-name {
    color: #e74c3c;
}

.music-song-item.no-audio {
    opacity: 0.7;
}

.music-song-cover-small {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.music-song-cover-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Playing Indicator Bars */
.music-playing-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 14px;
}

.music-playing-indicator span {
    width: 3px;
    background: #e74c3c;
    border-radius: 1px;
    animation: musicBounce 0.6s ease-in-out infinite alternate;
}

.music-playing-indicator span:nth-child(1) {
    height: 6px;
    animation-delay: 0s;
}

.music-playing-indicator span:nth-child(2) {
    height: 10px;
    animation-delay: 0.15s;
}

.music-playing-indicator span:nth-child(3) {
    height: 4px;
    animation-delay: 0.3s;
}

@keyframes musicBounce {
    0% {
        transform: scaleY(0.4);
    }

    100% {
        transform: scaleY(1);
    }
}

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

.music-song-name {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-song-artist {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-song-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
}

.music-song-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.music-empty {
    padding: 60px 20px;
    text-align: center;
    color: #bbb;
    font-size: 14px;
}

/* ===== Player View ===== */
.music-player {
    position: relative;
    background: #1a1a2e;
    color: #fff;
}

.music-player-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.3);
    transform: scale(1.2);
    z-index: 0;
}

.music-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.music-player>* {
    position: relative;
    z-index: 2;
}

.music-player-header {
    height: 80px;
    padding-top: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 14px;
    padding-right: 14px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.music-player-header-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.music-player-header-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.music-player-title-area {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.music-player-song-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-player-artist-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

/* Rotating Disc */
.music-disc-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.music-disc {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: linear-gradient(135deg, #111 0%, #333 50%, #111 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.05), 0 0 0 12px rgba(255, 255, 255, 0.02), 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s;
}

.music-disc.spinning {
    animation: discSpin 12s linear infinite;
}

@keyframes discSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.music-disc-inner {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.music-disc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Progress Bar */
.music-progress-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px;
    flex-shrink: 0;
    margin-bottom: 16px;
}

.music-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    min-width: 34px;
    text-align: center;
}

.music-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
}

.music-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Controls */
.music-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 20px 40px;
    flex-shrink: 0;
}

.music-ctrl-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
}

.music-ctrl-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.music-ctrl-play {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 50%;
    color: #fff;
}

.music-ctrl-play:active {
    background: rgba(255, 255, 255, 0.25) !important;
}

/* ===== Floating Mini Player (Vinyl Disc + Frosted Lyrics Panel) ===== */
.music-float-disc {
    position: absolute;
    z-index: 300;
    display: flex;
    align-items: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* Disc wrapper: contains vinyl + progress ring */
.mfd-disc-wrap {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    margin-right: -31px;
}

/* Progress ring SVG around vinyl */
.mfd-disc-wrap .mfd-progress-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 66px;
    height: 66px;
    transform: rotate(-90deg);
    z-index: 3;
    pointer-events: none;
}

.mfd-ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.12);
    stroke-width: 2.5;
}

.mfd-ring-fg {
    fill: none;
    stroke: #222;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s linear;
}

/* Vinyl disc (dark grooves) */
.mfd-vinyl {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
            #444 0%, #222 20%, #111 35%, #2a2a2a 37%,
            #1a1a1a 45%, #222 52%, #111 60%, #2a2a2a 62%,
            #1a1a1a 75%, #111 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* Vinyl grooves rings */
.mfd-vinyl::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    border: 0.5px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.015),
        inset 0 0 0 7px rgba(255, 255, 255, 0.01),
        inset 0 0 0 11px rgba(255, 255, 255, 0.008);
    pointer-events: none;
}

.music-float-disc.spinning .mfd-vinyl {
    animation: discSpin 12s linear infinite;
}

/* Cover art as center label */
.music-float-disc .mfd-cover {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: #555;
    position: relative;
    z-index: 1;
}

/* Play/Pause button - hidden on disc, controls are in lyrics panel */
.mfd-play-btn {
    display: none;
}

/* Frosted glass lyrics panel */
.mfd-lyrics-panel {
    width: 60vw;
    max-width: calc(var(--phone-width, 375px) * 0.6);
    padding: 6px 10px 5px 36px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 0 8px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 0.5px solid rgba(255, 255, 255, 0.5);
    pointer-events: auto;
    z-index: 1;
}

.mfd-lyric-text {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.4;
    text-align: center;
}

.mfd-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 1px 0;
}

.mfd-ctrl-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.mfd-ctrl-btn:active {
    background: rgba(0, 0, 0, 0.08);
}

.mfd-ctrl-btn.mfd-ctrl-play {
    width: 26px;
    height: 26px;
    background: #222;
    color: #fff;
    border-radius: 50%;
}

.mfd-ctrl-btn.mfd-ctrl-play:active {
    background: #444;
}

.music-float-disc .mfd-close {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.music-float-disc:hover .mfd-close,
.music-float-disc:active .mfd-close {
    opacity: 1;
}

/* ===== Listen Together Bar (in player view) ===== */
.music-listen-together-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    cursor: pointer;
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.music-listen-together-bar:active {
    color: #fff;
}

/* ===== Lyrics View (in Player) ===== */
.music-lyrics-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    overflow: hidden;
    cursor: pointer;
}

.music-lyrics-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 80px 24px;
    mask-image: linear-gradient(to bottom,
            transparent 0%,
            black 20%,
            black 75%,
            transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            transparent 0%,
            black 20%,
            black 75%,
            transparent 100%);
    scroll-behavior: smooth;
}

.lyric-line {
    text-align: center;
    font-size: 15px;
    line-height: 2.6;
    color: rgba(255, 255, 255, 0.35);
    transition: all 0.5s cubic-bezier(0.2, 0, 0.2, 1);
    cursor: pointer;
    padding: 2px 12px;
    border-radius: 8px;
}

.lyric-line:active {
    background: rgba(255, 255, 255, 0.05);
}

.lyric-line.active {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 24px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.lyric-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    padding: 60px 0;
}

.music-disc-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
}



/* ===== Music Card V2 — Inline Cover Design ===== */
.music-card-v2 {
    display: flex;
    align-items: center;
    min-width: 220px;
    max-width: 270px;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 10px 14px;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 0.5px solid #e0e0e0;
}

.music-card-v2:active {
    transform: scale(0.97);
}

.mc2-disc-area {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mc2-disc {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    position: relative;
    background: linear-gradient(135deg, #e8e0e6 0%, #c8b6c0 100%);
}

/* Vinyl grooves - hidden for inline style */
.mc2-disc::before {
    display: none;
}

.mc2-disc-inner {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.mc2-disc-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes mc2Spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.mc2-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mc2-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.mc2-artist {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.mc2-footer {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
    font-size: 11px;
    color: #bbb;
}

.mc2-footer svg {
    color: #ccc;
}

/* ===== Listen Together Banner ===== */
#listen-together-banner {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.lt-avatars {
    display: flex;
    align-items: center;
}

.lt-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.lt-avatar:nth-child(2) {
    margin-left: -8px;
}

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

.lt-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lt-song {
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lt-close {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lt-close:active {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Music Menu Buttons ===== */
.music-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s;
    text-align: left;
}

.music-menu-btn:active {
    background: #f5f5f5;
}

/* Screen Slide Animation */
@keyframes screenSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ========== Pomodoro Timer App ========== */
.pomodoro-app {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 50;
    flex-direction: column;
}

/* Header */
.pomo-header {
    height: 80px;
    padding-top: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 14px;
    padding-right: 14px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--pink-200);
    flex-shrink: 0;
    box-sizing: border-box;
}

.pomo-header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.pomo-header-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: 50%;
}

.pomo-header-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

/* Tabs */
.pomo-tabs {
    display: flex;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--pink-200);
    flex-shrink: 0;
}

.pomo-tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.pomo-tab-btn.active {
    color: var(--text-primary);
    font-weight: 600;
}

.pomo-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2.5px;
    background: var(--pink-accent);
    border-radius: 2px;
}

/* Tab Content */
.pomo-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pomo-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Mode Toggle */
.pomo-mode-toggle {
    display: flex;
    gap: 0;
    background: var(--pink-200);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 8px;
}

.pomo-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
}

.pomo-mode-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pomo-mode-btn svg {
    flex-shrink: 0;
}

/* Main Timer Area */
.pomo-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 16px 12px;
    gap: 8px;
    overflow-y: auto;
}

.pomo-state-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

/* Progress Ring */
.pomo-ring-container {
    position: relative;
    width: 170px;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pomo-ring-svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.pomo-ring-bg {
    fill: none;
    stroke: var(--pink-200);
    stroke-width: 5;
}

.pomo-ring-progress {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.pomo-ring-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pomo-timer-text {
    font-size: 36px;
    font-weight: 300;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

.pomo-current-task {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    max-width: 160px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Progress Dots */
.pomo-dots {
    display: flex;
    gap: 8px;
    margin: 2px 0;
}

.pomo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pink-300);
    transition: background 0.3s, transform 0.3s;
}

.pomo-dot.filled {
    background: var(--pink-accent);
    transform: scale(1.2);
}

/* Control Buttons */
.pomo-controls {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    justify-content: center;
    width: 100%;
    align-items: center;
    position: relative;
}

.pomo-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 26px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

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

.pomo-btn-start {
    background: var(--text-primary);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.pomo-btn-pause {
    background: var(--pink-500);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    padding: 11px 22px;
}

.pomo-btn-resume {
    background: var(--pink-accent);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    padding: 11px 22px;
}

.pomo-btn-stop {
    background: var(--pink-300);
    color: var(--text-secondary);
    box-shadow: none;
    padding: 11px 22px;
}

.pomo-btn-stop:active {
    background: var(--pink-400);
}

/* Session Stats */
.pomo-session-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 38px;
    padding: 10px 24px;
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.pomo-session-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.pomo-session-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.pomo-session-label {
    font-size: 11px;
    color: var(--text-muted);
}

.pomo-session-divider {
    width: 1px;
    height: 24px;
    background: var(--pink-200);
}

/* Start Modal */
.pomo-task-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

.pomo-task-option {
    padding: 6px 12px;
    background: var(--pink-100);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pomo-task-option:active,
.pomo-task-option.selected {
    background: var(--pink-accent);
    color: #fff;
}

.pomo-duration-picker {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.pomo-dur-btn {
    flex: 1;
    padding: 8px 0;
    border: 1.5px solid var(--pink-300);
    border-radius: 10px;
    background: var(--bg-card);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.pomo-dur-btn.active {
    border-color: var(--pink-accent);
    background: var(--pink-100);
    color: var(--text-primary);
}

/* Task List */
.pomo-task-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 2px;
}

.pomo-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

.pomo-task-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.pomo-task-count {
    font-size: 12px;
    color: var(--text-muted);
}

.pomo-task-actions {
    display: flex;
    gap: 6px;
}

.pomo-task-action-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--pink-100);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--pink-accent);
    transition: background 0.2s;
}

.pomo-task-action-btn.delete {
    color: #999;
}

.pomo-task-action-btn:active {
    background: var(--pink-200);
}

.pomo-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

/* Statistics */
.pomo-stats-today {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pomo-stats-today-title,
.pomo-stats-chart-title,
.pomo-stats-all-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.pomo-stats-today-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pomo-stats-card {
    background: var(--pink-100);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.pomo-stats-card-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.pomo-stats-card-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.pomo-stats-chart-section {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pomo-stats-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 110px;
    padding: 0 8px;
}

.pomo-chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.pomo-chart-bar {
    width: 18px;
    min-height: 4px;
    background: linear-gradient(180deg, var(--pink-accent) 0%, var(--pink-400) 100%);
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.pomo-chart-bar-val {
    position: absolute;
    top: -16px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pomo-chart-day {
    font-size: 11px;
    color: var(--text-muted);
}

.pomo-stats-all {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pomo-stats-all-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pomo-stats-all-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: var(--pink-100);
    border-radius: 10px;
}

.pomo-all-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.pomo-all-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Settings */
.pomo-setting-group {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pomo-setting-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.pomo-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 0.5px solid var(--pink-200);
    font-size: 14px;
    color: var(--text-primary);
}

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

.pomo-setting-input {
    width: 56px;
    padding: 5px 8px;
    border: 1px solid var(--pink-300);
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    color: var(--text-primary);
    background: var(--pink-100);
}

.pomo-setting-select {
    padding: 5px 10px;
    border: 1px solid var(--pink-300);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--pink-100);
    max-width: 140px;
}

.pomo-setting-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* Timer Section - compact to make room for companion */
.pomo-timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Companion Area (horizontal: avatar left, messages right) */
.pomo-companion-area {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    min-height: 0;
    padding: 4px 12px;
    gap: 10px;
    box-sizing: border-box;
}

.pomo-companion-avatar-wrap {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: var(--pink-100);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
}

.pomo-companion-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pomo-companion-avatar-placeholder {
    color: var(--pink-400);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pomo-companion-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0 4px;
    min-height: 0;
}

.pomo-companion-bubble {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--pink-200);
    border-radius: 2px 10px 10px 10px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    max-width: 90%;
    align-self: flex-start;
}

.pomo-bubble-animate {
    animation: pomoBubbleIn 0.35s ease-out;
}

@keyframes pomoBubbleIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Share Button — positioned absolutely so it doesn't affect centering */
.pomo-btn-share {
    position: absolute;
    right: calc(50% - 130px);
    padding: 4px 8px !important;
    min-width: unset !important;
    background: transparent !important;
    color: #999 !important;
    border-radius: 20px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pomo-btn-share:active {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Share Chat Picker */
.pomo-share-chat-list {
    max-height: 200px;
    overflow-y: auto;
}

.pomo-share-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    font-size: 14px;
}

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

.pomo-share-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Pomo Share Card in Chat */
.pomo-share-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 220px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pomo-share-card:active {
    transform: scale(0.97);
}

.pomo-share-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #d0d0d0 0%, #bbb 100%);
}

.pomo-share-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #fff;
}

.pomo-share-icon svg {
    width: 100%;
    height: 100%;
}

.pomo-share-header-text {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.pomo-share-mid {
    padding: 10px 12px 6px;
}

.pomo-share-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.pomo-share-detail {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

.pomo-share-ai-line {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
    line-height: 1.4;
}

.pomo-share-bottom {
    padding: 6px 12px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pomo-share-status {
    font-size: 12px;
    font-weight: 500;
}

.pomo-danger-btn {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: var(--pink-100);
    color: #999;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.pomo-danger-btn:active {
    background: var(--pink-200);
}

/* Completion Modal */
.pomo-complete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: pomoFadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.pomo-complete-card {
    background: var(--bg-card);
    border-radius: 0;
    padding: 28px 24px;
    text-align: center;
    width: 250px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: pomoPopIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}

.pomo-complete-icon {
    font-size: 48px;
    margin-bottom: 6px;
    animation: pomoBounce 0.6s ease 0.3s;
}

.pomo-complete-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pomo-complete-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.pomo-complete-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 10px;
}

.pomo-complete-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pomo-stat-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.pomo-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.pomo-complete-task {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 8px 14px;
    background: var(--pink-100);
    border-radius: 0;
}

.pomo-complete-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 0;
    background: var(--text-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.pomo-complete-btn:active {
    transform: scale(0.96);
}

/* Animations */
@keyframes pomoFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pomoPopIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pomoBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

@keyframes screenSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== 玩具邀请卡片 ========== */
.toyinvite-card {
    width: 220px;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(196, 69, 105, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.toyinvite-card:active {
    transform: scale(0.97);
}

.toyinvite-bg {
    position: relative;
    background: linear-gradient(135deg, #e8879b 0%, #d4637a 40%, #c44569 100%);
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.toyinvite-glow {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.toyinvite-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.toyinvite-text {
    text-align: center;
    color: #fff;
}

.toyinvite-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    margin-bottom: 4px;
}

.toyinvite-subtitle {
    font-size: 12px;
    opacity: 0.85;
    letter-spacing: 3px;
    font-weight: 400;
}

.toyinvite-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 50%, transparent 100%);
    animation: toyShimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes toyShimmer {
    0% {
        left: -100%;
    }

    50% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

.toyinvite-footer {
    background: rgba(255, 255, 255, 0.08);
    padding: 7px 14px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, #b83a55 0%, #a03050 100%);
}