
:root {
    --primary-color: #95EC69;
    --button-action-color: #07C160;
    --background-color: #EDEDED;
    --ios-header-bg: rgba(247, 247, 247, 0.85);
    --text-color: #000;
    --bubble-ai-bg: #FFFFFF;
    --bubble-user-bg: var(--primary-color);
    --font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    --footer-height: 60px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: var(--background-color); color: var(--text-color); overscroll-behavior-y: contain; }

/* 公告样式 */
.announcement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.announcement-container {
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    position: relative;
    margin: auto;
}

.announcement-container.show {
    opacity: 1;
    transform: scale(1);
}

.announcement-container.closing {
    opacity: 0;
    transform: scale(0.9);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: #000;
}

.announcement-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.announcement-header .close-btn {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.announcement-content {
    padding: 15px 20px;
    max-height: calc(80vh - 50px);
    overflow-y: auto;
}

.announcement-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.announcement-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.announcement-item h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.announcement-item p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
}

.announcement-item small {
    display: block;
    color: #999;
    font-size: 12px;
    text-align: right;
}
.container { display: flex; flex-direction: column; height: 100vh; width: 100%; margin: 0 auto; background-color: var(--background-color); transition: background-image 0.3s ease; background-size: cover; background-position: center; background-repeat: no-repeat; }
@media (min-width: 768px) { .container { max-width: 768px; box-shadow: 0 0 20px rgba(0,0,0,0.1); } }
.header, .footer { position: fixed; left: 0; right: 0; width: 100%; z-index: 10; }
.header { top: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background-color: rgba(247, 247, 247, 0.85); backdrop-filter: blur(50px); -webkit-backdrop-filter: blur(50px); border-bottom: none; }
.footer {
    /* 恢复 fixed 定位，这是元素固定在底部的关键 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10;
    
    /* 保持垂直堆叠和背景色 */
    display: flex; /* 使用flex布局来管理内部元素 */
    flex-direction: column;
    background-color: #F7F7F7;
    border-top: 1px solid #E0E0E0;
    padding-bottom: env(safe-area-inset-bottom);
}

/* iOS PWA模式下的底部适配 */
@media (display-mode: standalone) {
    .footer {
        padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
    }
    
    .action-toolbar {
        padding-bottom: 10px;
    }
}

/* 针对iOS设备的额外适配 */
@supports (-webkit-touch-callout: none) {
    @media (display-mode: standalone) {
        .footer {
            padding-bottom: calc(env(safe-area-inset-bottom) + 25px);
        }
    }
}

/*  限制 footer 在大屏幕下的宽度，与 header 保持一致 */
@media (min-width: 768px) {
    .footer {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 为新的包裹层 .input-container 添加样式 */
.input-container {
    /* 使用flex布局，让输入框区域和发送按钮对齐 */
    display: flex;
    align-items: flex-end; /* 底部对齐，以防输入框变高 */
    gap: 10px; /* 元素间距 */
    padding: 8px 10px;
}

/* 包裹两个输入框的容器 */
.input-wrapper {
    flex-grow: 1; /* 占据大部分空间 */
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}

@media (min-width: 768px) { .header, .footer { max-width: 768px; left: 50%; transform: translateX(-50%); } }
.header-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 17px; font-weight: 600; text-align: center; margin: 0; pointer-events: none; }
.header-title small { display: block; font-size: 12px; font-weight: 400; color: #A6A6A6; }
.icon-button { background: none; border: none; cursor: pointer; padding: 5px; color: var(--text-color); position: relative; z-index: 1; }
#settings-btn { margin-left: auto; }
.icon-button svg { display: block; }
.chat-window { flex-grow: 1; overflow-y: auto; padding: 80px 10px; overscroll-behavior-y: contain; }
.message { display: flex; align-items: flex-start; margin-bottom: 15px; max-width: 80%; }
.message.user { margin-left: auto; flex-direction: row-reverse; }
.message.ai { margin-right: auto; }
.message-avatar { width: 40px; height: 40px; border-radius: 50%; margin: 0 10px; object-fit: cover; flex-shrink: 0; }
.message-content { display: flex; flex-direction: column; }
.message-bubble { padding: 10px 15px; border-radius: 18px; word-wrap: break-word; word-break: break-all; font-size: 16px; line-height: 1.4; }
.message-time { font-size: 12px; color: #8E8E93; margin-top: 5px; }
.message.user .message-bubble { background-color: #95EC69; border-top-right-radius: 5px; }
.message.ai .message-bubble { background-color: #FFFFFF; border-top-left-radius: 5px; }

/* 系统动作文本样式优化 */
.message.action-text {
    justify-content: center; /* 水平居中 */
    max-width: 100%; /* 允许容器占据全部宽度以便居中 */
    margin-left: auto;
    margin-right: auto;
    padding: 0 60px; /* 左右留出间距，避免覆盖头像 */
}

.message.action-text .message-bubble {
    background-color: #E5E5EA; /* iOS系统灰色 */
    color: #8A8A8E; /* 文字颜色 */
    font-size: 13px; /* 稍小字体 */
    padding: 8px 12px;
    border-radius: 15px; /* 更圆润的边角 */
    text-align: center; /* 文本居中 */
    line-height: 1.5;
    box-shadow: none; /* 移除阴影 */
    max-width: 100%; /* 确保气泡本身不超过容器 */
}

/* 礼物消息样式 */
/* 礼物请帖封面样式 */
.message.gift .message-bubble {
    background: linear-gradient(135deg, #FFE4E1 0%, #FFF0F5 50%, #FFE4E1 100%);
    position: relative;
    padding: 0;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message.gift .message-bubble:hover {
    transform: translateY(-2px);
}

.gift-invitation-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 30px;
    text-align: center;
    min-height: 240px;
    justify-content: space-between;
    background: linear-gradient(135deg, #FFE4E6 0%, #FFF0F5 50%, #FFE4E6 100%);
}

.gift-card-header {
    font-size: 28px;
    font-weight: 600;
    color: #8B4B8C;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.gift-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
    gap: 16px;
}

.gift-card-open-btn {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #FF69B4, #FF1493);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    animation: giftButtonPulse 2s ease-in-out infinite;
}



.gift-card-footer {
    font-size: 15px;
    color: #ff3cbe;
    font-weight: 600;
    margin-top: 16px;
    letter-spacing: 4px;
}

/* 礼物按钮动画效果 */
@keyframes giftButtonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.message.user .message-time { text-align: right; }
.typing-indicator { display: flex; align-items: center; }
.typing-indicator span { height: 8px; width: 8px; background-color: #B2B2B2; border-radius: 50%; display: inline-block; margin: 0 2px; animation: bounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

#message-input {
    /* 精细化输入框样式，使其更美观 */
    flex-grow: 1;
    border: none;
    background-color: transparent; /* 背景由父容器.input-wrapper提供 */
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 16px;
    outline: none;
    width: 100%; /* 宽度占满父容器 */
    min-height: 40px; /* 确保最小高度 */
}



.send-button { background-color: #95EC69; color: var(--text-color); border: none; border-radius: 8px; padding: 10px 15px; margin-left: 10px; font-size: 16px; font-weight: 500; cursor: pointer; transition: background-color 0.2s ease; }
.send-button:disabled { background-color: #BDBDBD; cursor: not-allowed; }
.settings-panel { position: fixed; top: 0; right: -100%; width: 90%; max-width: 400px; height: 100%; background-color: #F2F2F7; box-shadow: -5px 0 15px rgba(0,0,0,0.1); z-index: 100; transition: right 0.3s ease-in-out; display: flex; flex-direction: column; }
.settings-panel.open { right: 0; }
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #E0E0E0; background-color: #F7F7F7; flex-shrink: 0; }
.settings-header h2 { font-size: 17px; font-weight: 600; }
#close-settings-btn { font-size: 24px; font-weight: 300; }
.settings-content { flex-grow: 1; overflow-y: auto; padding: 20px 16px; }
.setting-group { background-color: #FFFFFF; border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.setting-group h3 { text-align: center; padding: 20px 16px 10px; font-weight: 500; }
.setting-group > p { text-align: center; color: #666; font-size: 14px; padding: 0 16px 20px; }
.setting-group .form-container { padding: 16px; }
.form-container-bottom { margin-bottom: 20px; }
.setting-group .setting-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #F2F2F7; font-size: 16px; }
.setting-group .setting-item:last-child { border-bottom: none; }
.setting-item label { color: #000; }
.setting-item input[type="text"], .setting-item input[type="password"], .setting-item select { border: none; outline: none; text-align: right; font-size: 16px; color: #8A8A8E; width: 60%; background: transparent; }
.setting-item textarea { width: 100%; padding: 8px; border-radius: 5px; border: 1px solid #E0E0E0; font-size: 14px; margin-top: 5px; resize: vertical; }
.setting-group .textarea-item { flex-direction: column; align-items: flex-start; }
.setting-group .textarea-item label { margin-bottom: 8px; }
.avatar-uploader { display: flex; align-items: center; padding: 10px 16px; justify-content: space-between; border-bottom: 1px solid #F2F2F7; cursor: pointer; }
.avatar-uploader .avatar-preview { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
/* Modal样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.modal-buttons .btn {
    margin: 0 10px;
}

.btn { width: 100%; padding: 12px; border: none; border-radius: 8px; font-size: 16px; font-weight: 500; cursor: pointer; margin-top: 10px; transition: opacity 0.2s ease, background-color 0.2s ease; }
.btn:hover:not(:disabled) { opacity: 0.8; }
.btn-primary { background-color: #07C160; color: white; }
.btn-danger { background-color: #07C160; color: white; }
.btn-secondary { background-color: #EFEFF4; color: #007AFF; }
.btn:disabled { background-color: #D1D1D6; color: #8A8A8E; cursor: not-allowed; opacity: 1; }
.expandable-list-container { max-height: 150px; overflow-y: auto; transition: max-height 0.5s ease-in-out; padding: 0 16px 10px; position: relative; }
.expandable-list-container.expanded { max-height: 300px; }
.list-item { background-color: #F7F7F7; padding: 8px 12px; border-radius: 5px; margin-bottom: 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.list-item-content { flex-grow: 1; word-break: break-all; }
.list-item-content span { display: inline-block; width: 100%; }
.list-item-time { font-size: 12px; color: #8E8E93; display: block; margin-top: 4px; }
.delete-btn { background: none; border: none; color: #FF3B30; cursor: pointer; font-size: 18px; margin-left: 10px; padding: 5px; }
.expand-btn-container { text-align: center; padding: 0 16px 10px; }
.expand-btn { background: none; border: none; color: #07C160; cursor: pointer; font-size: 14px; }
.system-info p { font-size: 14px; color: #666; margin-bottom: 5px; display: flex; justify-content: space-between; }
.system-info p span:first-child { font-weight: 500; }

/* 梦元信息项样式 */
.token-info-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.token-info-item p {
    margin: 0;
    flex: 1;
}

/* 帮助按钮样式 */
.help-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    color: #666;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.help-btn:hover {
    background-color: #e8e8e8;
    border-color: #999;
    color: #333;
}
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1300; }
.modal-content { background-color: white; padding: 20px; border-radius: 12px; text-align: center; position: relative; max-width: 90%; }
.close-modal-btn { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: #999; }

/* 梦元记录Tab样式 */
.token-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.token-tab {
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    position: relative;
}

.token-tab.active {
    color: #07C160;
}

.token-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #07C160;
}

/* 梦元记录列表样式 */
.token-records-note {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
    padding: 0 10px;
}

.token-records-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.token-records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.token-record-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding: 10px;
    border-radius: 5px;
    background-color: #f8f9fa;
    align-items: center;
    text-align: left;
}

.token-record-type {
    font-weight: 500;
}

.token-record-amount {
    color: #07C160;
    font-weight: bold;
}

.token-record-time {
    color: #666;
    font-size: 0.9em;
}

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

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

.no-records {
    text-align: center;
    color: #666;
    padding: 20px;
}

.error-message {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}
.story-header { justify-content: space-between; align-items: center; }
.story-header #generate-story-btn { margin-top: 0; width: auto; padding: 5px 10px; font-size: 14px; }



/* 充值套餐样式 - iOS设计规范 */
.recharge-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
}

.recharge-package {
    background: #FFFFFF;
    border: 1.5px solid #E5E5EA;
    border-radius: 12px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recharge-package:hover {
    border-color: var(--button-action-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.15);
}

.recharge-package.selected {
    border-color: var(--button-action-color);
    background: linear-gradient(135deg, #F0FFF5 0%, #E6F9F0 100%);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.2), 0 4px 12px rgba(7, 193, 96, 0.15);
    transform: translateY(-1px);
}

.recharge-package.selected::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--button-action-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(7, 193, 96, 0.3);
}

.recharge-package.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.recharge-package .package-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.recharge-package .package-tokens {
    font-size: 18px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 8px;
    line-height: 1.2;
}

.recharge-package .package-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--button-action-color);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .recharge-packages {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .recharge-package {
        padding: 16px 12px;
        min-height: 90px;
    }

    .recharge-package .package-tokens {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .recharge-package .package-price {
        font-size: 20px;
    }

    .recharge-package.selected::after,
    .recharge-package.selected::before {
        width: 18px;
        height: 18px;
        top: 6px;
        right: 6px;
    }
}

/* 桌面端适配 */
@media (min-width: 768px) {
    .recharge-packages {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding: 20px;
    }

    .recharge-package {
        padding: 24px 20px;
        min-height: 120px;
    }

    .recharge-package .package-tokens {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .recharge-package .package-price {
        font-size: 28px;
    }
}

/* 充值区域优化 */
#recharge-section .setting-group h3 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 8px;
}

#recharge-section .btn {
    margin-top: 8px;
    transition: all 0.2s ease;
}

#recharge-section .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* v5.2.1基准版修改v6 */
/* 文件: public/style.css */
/* 优化: 彻底重写全屏编辑器样式，采用覆盖式UI，根治iOS键盘问题。 */

/* 当编辑器激活时，隐藏主应用容器 */
body.editor-active .container {
    display: none;
}

/* 编辑器容器 (不再需要遮罩层，自身就是全屏) */
.fullscreen-editor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* 占满整个屏幕 */
    z-index: 2000; /* 使用一个非常高的z-index */
    background-color: #F2F2F7; /* 使用设置页的背景色 */
    display: flex;
    flex-direction: column;
    padding: 10px;
    /* 为iPhone安全区域预留底部空间 */
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    opacity: 0;
    transform: translateY(100%); /* 从底部滑入 */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.fullscreen-editor-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 编辑器内的textarea */
.fullscreen-editor-textarea {
    width: 100%;
    flex-grow: 1; /* 占据所有可用垂直空间 */
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    margin-bottom: 10px; /* 与按钮的间距 */
}
.fullscreen-editor-textarea:focus {
    border-color: #07C160;
}

/* 编辑器内的“完成”按钮 */
.editor-done-btn {
    flex-shrink: 0; /* 防止被压缩 */
    width: 100%;
    background-color: #07C160;
    color: white;
}

/* v5.2.1基准版修改v8 */
/* 文件: public/style.css */
/* 新增: 用于“故事已更新”的Toast提示样式和动画。 */

/* Toast 容器样式 */
.toast-notification {
    position: fixed;
    top: 20px; /* 从顶部滑入 */
    left: 50%;
    transform: translate(-50%, -100%); /* 初始位置在屏幕外上方 */
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 25px; /* 胶囊形状 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999; /* 确保在最顶层 */
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Toast 显示时的状态 (入场动画) */
.toast-notification.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* v1.0.0.1 新增: 设置项描述文字样式 */
.setting-item-description {
    font-size: 12px;
    color: #8A8A8E;
    padding: 0 16px 12px;
    line-height: 1.4;
    border-bottom: 1px solid #F2F2F7;
}


/* [角色实时状态指示器 v1] 新增样式 */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cccccc; /* 默认灰色 */
    margin-right: 6px;
    vertical-align: middle;
    transition: background-color 0.5s ease; /* 颜色变化动画 */
}

.status-indicator.idle {
    background-color: #34C759; /* 空闲时为绿色 */
}

.status-indicator.busy {
    background-color: #FF3B30; /* 忙碌时为红色 */
}

/* [聊天记录分页加载 v1] 新增样式 */
.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #8A8A8E;
    font-size: 14px;
    gap: 10px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #07C160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}



/* 长按删除消息样式 */
.message {
    user-select: none; /* 防止长按时选中文本 */
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* 禁用iOS长按菜单 */
    -webkit-tap-highlight-color: transparent; /* 禁用点击高亮 */
}

.message.long-press {
    background-color: rgba(255, 59, 48, 0.15);
    border-radius: 12px;
    transition: all 0.2s ease;
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.2);
}

.message.long-press .message-bubble {
    background-color: rgba(255, 59, 48, 0.1) !important;
}

/* 长按提示样式 */
.long-press-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.long-press-hint.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

#chat-days {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 平台协议链接样式 */
.platform-agreements {
    text-align: center;
    padding: 20px 16px;
    border-top: 1px solid #F2F2F7;
    margin-top: 20px;
}

.agreements-link {
    color: #8E8E93;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.agreements-link:hover {
    color: #007AFF;
}

/* 协议勾选区域样式 */
.agreements-checkbox-group {
    /* margin: 16px 0 8px 0; */
    padding: 10px 0 4px 0;
    color: #8E8E93; /* 与其他灰色文案统一 */
    font-size: 14px;
}

.agreement-checkbox-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.agreement-checkbox-item:last-child {
    margin-bottom: 0;
}

.agreement-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #007AFF;
}

.agreement-checkbox-item label {
    color: inherit; /* 继承父级灰色 */
    cursor: pointer;
    flex: 1;
}

.agreement-link {
    color: inherit;
    text-decoration: none;
    font-weight: normal;
}

.agreement-link:hover {
    text-decoration: underline;
}

.agreement-link:active {
    color: inherit;
}

/* 协议模态框样式 */
.agreement-modal-content {
    max-width: 90%;
    max-height: 80vh;
    width: 800px;
    overflow-y: auto;
    padding: 20px;
}

.agreement-modal-content h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.agreement-modal-content h2 {
    margin-top: 30px;
    padding-bottom: 5px;
    font-size: 18px;
    font-weight: 600;
}

.agreement-modal-content h3 {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
}

.agreement-modal-content p {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.agreement-modal-content ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.agreement-modal-content li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.agreement-modal-content strong {
    font-weight: 600;
}

@media (max-width: 480px) {
    .agreement-modal-content {
        max-width: 95%;
        padding: 16px;
    }

    .agreement-modal-content h1 {
        font-size: 20px;
    }

    .agreement-modal-content h2 {
        font-size: 16px;
    }

    .agreement-modal-content h3 {
        font-size: 15px;
    }

    .agreement-modal-content p,
    .agreement-modal-content li {
        font-size: 13px;
    }
}

/* 情景模式输入区样式 */
.scene-input-area {
    /* 移除外边距和边框，由父容器.input-wrapper统一处理 */
    /* padding-bottom: 8px; */
    /* border-bottom: 1px solid #EAEAEA;     */
    /* margin-bottom: 8px; */
}
#description-input {
    width: 100%;
    height: 45px;
    padding: 10px 15px;
    border: none;
    background-color: transparent; /* 背景由父容器.input-wrapper提供 */
    border-bottom: 1px solid #EAEAEA; /* 在两个输入框之间加一条分隔线 */
    border-radius: 0; /* 移除圆角，因为在.input-wrapper内部 */
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    outline: none;
    color: #555;
}
#description-input::placeholder {
    color: #BDBDBD;
}

/*  底部功能图标栏样式 */
.action-toolbar {
    display: flex;
    /* 从 space-around 改为 flex-start，让图标从左侧开始排列 */
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 5px 15px; /* 增加左右内边距 */
    border-top: 1px solid #EAEAEA;
    background-color: #F7F7F7;
    gap: 20px; /* 图标之间的间距 */
}
.toolbar-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: #666;
    padding: 0;
    position: relative; /* 为红点定位提供相对容器 */
}
.toolbar-button svg {
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
    color: #333;
}
.toolbar-button:active {
    opacity: 0.6;
}

/* 4. 新增: 模式切换面板样式 */
.mode-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mode-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #F2F2F7;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
.mode-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #E0E0E0;
}
.mode-panel-header h4 {
    font-size: 16px;
    font-weight: 600;
}
#close-mode-panel-btn {
    font-size: 24px;
    font-weight: 300;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
}
.mode-options {
    padding: 20px;
    display: flex;
    gap: 15px;
}
.mode-option {
    flex: 1;
    padding: 15px;
    background-color: #FFFFFF;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.mode-option.active {
    border-color: var(--button-action-color);
}
.mode-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.mode-icon-wrapper {
    margin-bottom: 10px;
}
.mode-icon-wrapper svg {
    color: var(--button-action-color);
}
.mode-option h5 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #000;
}
.mode-option p {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* 5. 新增: 聊天窗口中的“描写”消息样式 (action_text) */
.message.action-text {
    max-width: 100%;
    justify-content: center;
    margin: 10px 0;
}
.message.action-text .message-bubble {
    background-color: #E3E3E8;
    color: #555;
    font-size: 13px;
    text-align: center;
    padding: 4px 12px;
    border-radius: 15px;
}
/* 隐藏 action_text 类型的头像和时间 */
.message.action-text .message-avatar,
.message.action-text .message-time {
    display: none;
}
/* 覆盖气泡的特定样式 */
.message.action-text .message-bubble {
    border-top-left-radius: 15px !important;
    border-top-right-radius: 15px !important;
}

/* 表情包选择面板样式 */
.emoticon-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.emoticon-panel {
    background: #F7F7F7;
    border-radius: 20px 20px 0 0;
    width: 100%;
    height: 40vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.emoticon-panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #E5E5EA;
}

.emoticon-panel-header h4 {
    margin: 0;
    color: #1C1C1E;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

/* 发图片面板样式 */
.image-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.image-panel {
    background: #F7F7F7;
    border-radius: 20px 20px 0 0;
    width: 100%;
    height: 50vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.image-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #E5E5EA;
}

.image-panel-header h4 {
    margin: 0;
    color: #1C1C1E;
    font-size: 17px;
    font-weight: 600;
}

.image-panel-description {
    padding: 0 20px 12px 20px;
    border-bottom: 1px solid #E5E5EA;
    background: #F7F7F7;
}

.image-panel-description p {
    margin: 6px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.image-panel-description strong {
    color: #1C1C1E;
    font-weight: 600;
}

.panel-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #8E8E93;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close-btn:hover {
    color: #1C1C1E;
}

.image-upload-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.image-upload-area {
    flex: 1;
    border: 2px dashed #C7C7CC;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FFFFFF;
}

.image-upload-area:hover {
    border-color: #007AFF;
    background: #F0F8FF;
}

.upload-placeholder {
    text-align: center;
    color: #8E8E93;
}

.upload-placeholder svg {
    margin-bottom: 12px;
    color: #C7C7CC;
}

.upload-placeholder p {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: #1C1C1E;
}

.upload-placeholder span {
    font-size: 14px;
    color: #8E8E93;
}

.image-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.image-preview-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#user-image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.image-info span {
    font-size: 14px;
    color: #8E8E93;
}

#image-file-name {
    font-weight: 500;
    color: #1C1C1E;
}

.image-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.image-actions .btn {
    flex: 1;
    max-width: 120px;
}

/* 移动端发图片面板按钮优化 */
@media (max-width: 480px) {
    .image-actions {
        gap: 8px;
        padding: 0 10px;
    }
    
    .image-actions .btn {
        flex: 1;
        max-width: none;
        min-width: 100px;
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    /* 确保图片预览容器在移动端有足够空间 */
    .image-preview-container {
        min-height: 200px;
    }
    
    /* 优化图片预览尺寸 */
    #user-image-preview {
        max-height: 150px;
    }
    
    /* 优化图片面板高度 */
    .image-panel {
        height: 60vh;
        max-height: 500px;
    }
}

/* 礼物选择面板样式 */
.gift-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.gift-panel {
    background: #F7F7F7;
    border-radius: 20px 20px 0 0;
    width: 100%;
    height: 45vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.gift-panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #E5E5EA;
}

.gift-panel-header h4 {
    margin: 0;
    color: #1C1C1E;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

.gift-panel-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #8E8E93;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
    max-width: 100%;
}

.gift-item {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #E5E5EA;
    padding: 8px;
}

.gift-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gift-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gift-icon {
    font-size: 32px;
    margin-bottom: 4px;
    line-height: 1;
}

.gift-name {
    font-size: 12px;
    color: #1C1C1E;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

/* 自定义礼物弹窗样式 */
.custom-gift-form {
    text-align: left;
    margin: 20px 0;
}

.custom-gift-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1C1C1E;
}

.custom-gift-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #E5E5EA;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.custom-gift-form input:focus {
    border-color: var(--button-action-color);
}

.input-hint {
    font-size: 12px;
    color: #8E8E93;
    margin-top: 8px;
    line-height: 1.4;
}



/* 礼物详情弹窗样式 */
.gift-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gift-detail-content {
    background: linear-gradient(135deg, #FFE5F1 0%, #FFE5E5 50%, #FFF0E5 100%);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(255, 105, 180, 0.3);
    animation: giftModalSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes giftModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gift-detail-header {
    position: relative;
    padding: 16px 20px 0;
    text-align: right;
}

.gift-close-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gift-close-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.gift-detail-body {
    padding: 20px;
    text-align: center;
    position: relative;
}

.gift-animation-container {
    position: relative;
    height: 120px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-box {
    position: relative;
    width: 80px;
    height: 80px;
    animation: giftBoxFloat 3s ease-in-out infinite;
}

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

.gift-base {
    width: 80px;
    height: 60px;
    background: linear-gradient(135deg, #FF6B9D, #FF8E9B);
    border-radius: 8px;
    position: absolute;
    bottom: 0;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.gift-lid {
    width: 84px;
    height: 25px;
    background: linear-gradient(135deg, #FF8E9B, #FFB4B4);
    border-radius: 8px 8px 4px 4px;
    position: absolute;
    top: 0;
    left: -2px;
    box-shadow: 0 2px 8px rgba(255, 142, 155, 0.3);
    animation: giftLidBounce 2s ease-in-out infinite;
}

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

.gift-ribbon-v {
    width: 8px;
    height: 80px;
    background: linear-gradient(180deg, #FFD700, #FFA500);
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

.gift-ribbon-h {
    width: 80px;
    height: 8px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

.gift-sparkles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 16px;
    animation: sparkleFloat 2s ease-in-out infinite;
    opacity: 0.8;
}

.sparkle-1 {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 20%;
    right: 15%;
    animation-delay: 0.5s;
}

.sparkle-3 {
    bottom: 30%;
    left: 10%;
    animation-delay: 1s;
}

.sparkle-4 {
    bottom: 20%;
    right: 20%;
    animation-delay: 1.5s;
}

.sparkle-5 {
    top: 50%;
    left: 5%;
    animation-delay: 0.8s;
}

.sparkle-6 {
    top: 40%;
    right: 5%;
    animation-delay: 1.2s;
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-15px) rotate(180deg);
        opacity: 1;
    }
}

.gift-info {
    position: relative;
    z-index: 10;
}

.gift-info h2 {
    color: #FF6B9D;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 4px rgba(255, 107, 157, 0.2);
}

.gift-detail-icon {
    font-size: 48px;
    margin: 16px 0;
    animation: giftIconPulse 2s ease-in-out infinite;
}

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

.gift-info p {
    color: #666;
    font-size: 16px;
    margin: 16px 0;
    font-weight: 500;
}

.gift-detail-from {
    color: #888;
    font-size: 14px;
    margin: 12px 0;
}

.gift-detail-from span:first-child {
    color: #999;
}

.gift-detail-from span:last-child {
    color: #FF6B9D;
    font-weight: 600;
}

.gift-detail-time {
    color: #AAA;
    font-size: 12px;
    margin: 8px 0;
}

.gift-detail-footer {
    padding: 0 20px 24px;
    text-align: center;
}

.gift-detail-footer .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #FF6B9D, #FF8E9B);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.gift-detail-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.gift-detail-footer .btn:active {
    transform: translateY(0);
}

.emoticon-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.emoticon-grid-container::-webkit-scrollbar {
    width: 6px;
}

.emoticon-grid-container::-webkit-scrollbar-thumb {
    background-color: #D1D1D6;
    border-radius: 3px;
}

.emoticon-grid-container::-webkit-scrollbar-track {
    background-color: transparent;
}

.emoticon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 16px;
}

.emoticon-item {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #E5E5EA;
}

.emoticon-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.emoticon-item.selected {
    border: 2px solid var(--button-action-color);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.2);
}

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

.emoticon-item.add-emoticon {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
}

.emoticon-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.emoticon-item.add-emoticon:hover {
    border-color: #07C160;
    color: #07C160;
}

/* Emoticon Management - iOS Style */
.emoticon-manage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F9F9F9;
    z-index: 1200;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.emoticon-manage-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emoticon-manage-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E5EA;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background-color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.emoticon-manage-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1D1D1F;
}

.emoticon-manage-content {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #F9F9F9;
}

.emoticon-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.emoticon-manage-item {
    position: relative;
    background-color: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1.5px solid transparent;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.emoticon-manage-item img {
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.emoticon-manage-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 122, 255, 0.5);
}

.emoticon-manage-item:hover img {
    transform: scale(1.05);
}

.emoticon-manage-item.add-emoticon {
    border: 2px dashed #D1D1D6;
    background-color: #F2F2F7;
    box-shadow: none;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.emoticon-manage-item.add-emoticon:hover {
    border-color: var(--button-action-color);
    background-color: #E9E9EF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.emoticon-manage-item.add-emoticon svg {
    width: 32px;
    height: 32px;
    color: #C7C7CC;
    transition: all 0.2s ease;
    stroke-width: 1.5;
}

.emoticon-manage-item.add-emoticon span {
    font-size: 12px;
    color: #8E8E93;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    transition: color 0.2s ease;
    margin-top: 4px;
}

.emoticon-manage-item.add-emoticon:hover svg {
    color: var(--button-action-color);
    transform: scale(1.1);
}

.emoticon-manage-item.add-emoticon:hover span {
    color: var(--button-action-color);
}

.emoticon-manage-item .emoticon-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.emoticon-manage-item:hover .emoticon-actions {
    opacity: 1;
    pointer-events: auto;
}

.emoticon-manage-item .emoticon-actions button {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    color: #1D1D1F;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.emoticon-manage-item .emoticon-actions button:hover {
    background-color: #fff;
    transform: scale(1.1);
}

.emoticon-manage-item .emoticon-actions button.delete-btn:hover {
    color: #FF3B30; /* iOS destructive red */
}

/* 表情包编辑弹窗样式 - iOS设计规范 */
.emoticon-edit-content {
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow: hidden;
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    text-align: left;
}

.emoticon-edit-content h3 {
    margin: 0;
    padding: 24px 24px 16px;
    font-size: 20px;
    font-weight: 600;
    color: #1D1D1F;
    text-align: center;
    border-bottom: 1px solid #F2F2F7;
}

.emoticon-edit-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.emoticon-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: #F9F9F9;
    border-radius: 12px;
}

.emoticon-preview {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 16px;
    border: 3px solid #E5E5EA;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.emoticon-upload-area {
    width: 140px;
    height: 140px;
    border: 2px dashed #C7C7CC;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #8E8E93;
    text-align: center;
    gap: 12px;
    background-color: #FFFFFF;
}

.emoticon-upload-area:hover {
    border-color: #07C160;
    color: #07C160;
    background-color: #F0FFF4;
    transform: scale(1.02);
}

.emoticon-upload-area svg {
    transition: transform 0.2s ease;
}

.emoticon-upload-area:hover svg {
    transform: translateY(-2px);
}

.emoticon-upload-area p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

.emoticon-upload-area small {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.2;
}

.emoticon-meaning-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.emoticon-meaning-container label {
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 4px;
}

.emoticon-meaning-container input {
    padding: 16px;
    border: 2px solid #E5E5EA;
    border-radius: 12px;
    font-size: 16px;
    background-color: #FFFFFF;
    color: #1D1D1F;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.emoticon-meaning-container input:focus {
    outline: none;
    border-color: #07C160;
    background-color: #F0FFF4;
    box-shadow: 0 0 0 4px rgba(7, 193, 96, 0.1);
}

.emoticon-meaning-container input::placeholder {
    color: #C7C7CC;
    font-weight: 400;
}

/* 弹窗按钮样式优化 */
.emoticon-edit-content .modal-buttons {
    margin: 0;
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #F2F2F7;
    background-color: #FAFAFA;
}

.emoticon-edit-content .modal-buttons .btn {
    flex: 1;
    margin: 0;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.emoticon-edit-content .modal-buttons .btn-secondary {
    background-color: #F2F2F7;
    color: #07C160;
    border: 1px solid #E5E5EA;
}

.emoticon-edit-content .modal-buttons .btn-secondary:hover:not(:disabled) {
    background-color: #E5E5EA;
    transform: translateY(-1px);
}

.emoticon-edit-content .modal-buttons .btn-primary {
    background-color: #07C160;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

.emoticon-edit-content .modal-buttons .btn-primary:hover:not(:disabled) {
    background-color: #059A4C;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
}

.emoticon-edit-content .modal-buttons .btn:disabled {
    background-color: #F2F2F7;
    color: #C7C7CC;
    border: 1px solid #E5E5EA;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 表情包消息样式 */
.message.user.emoticon {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    max-width: 80%;
    padding: 8px 12px;
    margin-left: auto;
    flex-direction: row-reverse;
}

.message.ai.emoticon {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    max-width: 80%;
    padding: 8px 12px;
    margin-right: auto;
}

/* 表情包消息头像，ai和user分开 */
.message.user.emoticon .message-avatar {
    margin: 0px 0px 10px 10px;
}
.message.ai.emoticon .message-avatar {
    margin: 0px 10px 10px 0px;
}

/* 表情包消息图片，ai和user分开 */

.message.user.emoticon .emoticon-image
 {
    margin: 0px 5px;
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.message.ai.emoticon .emoticon-image {
    margin: 0px 5px;
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

/* 表情包消息图片悬停，ai和user分开 */
.message.user.emoticon .emoticon-image:hover {
    transform: scale(1.1);
}
.message.ai.emoticon .emoticon-image:hover {
    transform: scale(1.1);
}

/* 动画 */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 响应式调整 */
@media (max-width: 480px) {
    .emoticon-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .emoticon-manage-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .emoticon-preview,
    .emoticon-upload-area {
        width: 100px;
        height: 100px;
    }
}

/* =================================================================
   PWA安装按钮样式优化
   ================================================================= */

/* PWA安装区域样式 - 使用更高优先级的选择器 */
#pwa-install-section.setting-group {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    border: 1px solid #e9ecef !important;
    border-radius: 16px !important;
    padding: 24px !important;
    margin: 20px 0 !important;
    color: #333 !important;
    text-align: center !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    position: relative !important;
    overflow: hidden !important;
}

#pwa-install-section.setting-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007aff, #00d4ff);
}

#pwa-install-section.setting-group h3 {
    color: #333 !important;
    margin-bottom: 15px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    padding: 0 0 15px 0 !important;
}

#pwa-install-section.setting-group .setting-item {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    border-bottom: none !important;
    padding: 0 !important;
}

#pwa-install-section.setting-group .setting-item p {
    color: #666 !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
    font-size: 15px !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* PWA安装按钮基础样式 */
#pwa-install-section.setting-group #install-pwa-btn {
    background: #007aff !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3) !important;
    margin-top: 10px !important;
    min-width: 160px !important;
    width: auto !important;
}

#pwa-install-section.setting-group #install-pwa-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056cc, #007aff) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4) !important;
}

#pwa-install-section.setting-group #install-pwa-btn:active {
    transform: translateY(0) !important;
}

#pwa-install-section.setting-group #install-pwa-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}





/* PWA安装成功状态 */
#pwa-install-section.setting-group.installed {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

/* 响应式设计 */
@media (max-width: 480px) {
    #pwa-install-section.setting-group {
        padding: 20px 16px !important;
        margin: 15px 0 !important;
        border-radius: 12px !important;
    }
    
    #pwa-install-section.setting-group h3 {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }
    
    #pwa-install-section.setting-group .setting-item p {
        font-size: 14px !important;
        margin-bottom: 16px !important;
        line-height: 1.5 !important;
    }
    
    #pwa-install-section.setting-group #install-pwa-btn {
        padding: 12px 24px !important;
        font-size: 15px !important;
        min-width: 140px !important;
    }
}

/* 应用安装功能样式 - 绿色主题设计 */
#app-install-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: linear-gradient(135deg, #07C160 0%, #00A854 100%);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

#app-install-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 16px rgba(7, 193, 96, 0.4);
}

#app-install-btn svg {
    width: 20px;
    height: 20px;
}

.app-install-modal {
    max-width: 420px;
    width: 92%;
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.app-install-modal .modal-header {
    background: #ffffff;
    color: #333;
    padding: 24px 24px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.app-install-modal .modal-header .app-info {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.app-install-modal .modal-header .app-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: white;
    padding: 2px;
}

.app-install-modal .modal-header .app-details {
    flex: 1;
    text-align: left;
}

.app-install-modal .modal-header .app-name {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #333;
    background: linear-gradient(135deg, #07C160 0%, #00A854 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-install-modal .modal-header .install-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    letter-spacing: 0.2px;
}

.app-install-modal .close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f5;
    border: none;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.app-install-modal .close-btn:hover {
    background: #e8e8e8;
    color: #333;
    transform: translateY(-50%) rotate(90deg);
}

.app-install-options {
    padding: 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fffe 100%);
}

.app-install-option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border: 2px solid #e8f5e8;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.app-install-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(7, 193, 96, 0.1), transparent);
    transition: left 0.6s ease;
}

.app-install-option:hover {
    border-color: #07C160;
    background: linear-gradient(135deg, #f0fff4 0%, #e6ffe6 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(7, 193, 96, 0.2);
}

.app-install-option:hover::before {
    left: 100%;
}

.app-install-option:active {
    transform: translateY(-2px) scale(1.01);
}

.install-icon {
    margin-right: 18px;
    color: #07C160;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #e6ffe6 0%, #ccffcc 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.app-install-option:hover .install-icon {
    background: linear-gradient(135deg, #07C160 0%, #00A854 100%);
    color: white;
    transform: scale(1.1);
}

.install-text h4 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2d5016;
    letter-spacing: 0.3px;
}

.install-text p {
    margin: 0;
    font-size: 14px;
    color: #5a7c47;
    line-height: 1.4;
}

.download-progress {
    padding: 24px;
    border-top: 1px solid #e8f5e8;
    background: linear-gradient(180deg, #f0fff4 0%, #e6ffe6 100%);
    position: relative;
}

.download-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #07C160, transparent);
}

.progress-text {
    text-align: center;
    margin-bottom: 12px;
    font-size: 15px;
    color: #2d5016;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e8f5e8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #07C160 0%, #00A854 50%, #07C160 100%);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 25%, 
        rgba(255, 255, 255, 0.3) 25%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 50%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.3) 75%);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-percent {
    text-align: center;
    font-size: 13px;
    color: #2d5016;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 隐藏下载入口区域样式 */
.hide-download-section {
    padding: 12px 24px 16px;
    border-top: 1px solid #f0f0f0;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    text-align: center;
}

.hide-download-btn {
    background: #f8f8f8;
    border: none;
    color: #555555;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    display: inline-block;
    opacity: 0.8;
}

.hide-download-btn:hover {
    background: #eeeeee;
    color: #666;
    opacity: 1;
    transform: translateY(-1px);
}

.hide-download-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
    margin: 0;
    max-width: 320px;
    margin: 0 auto;
}

/* 响应式调整 - 绿色主题 */
@media (max-width: 480px) {
    #app-install-btn {
        left: 10px;
        width: 32px;
        height: 32px;
    }
    
    #app-install-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .app-install-modal {
        width: 96%;
        margin: 15px auto;
        border-radius: 16px;
    }
    
    .app-install-modal .modal-header {
        padding: 20px 20px;
    }
    
    .app-install-modal .modal-header .app-info {
        gap: 12px;
    }
    
    .app-install-modal .modal-header .app-logo {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }
    
    .app-install-modal .modal-header .app-name {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .app-install-modal .modal-header .install-title {
        font-size: 14px;
    }
    
    .app-install-options {
        padding: 20px 20px;
        gap: 14px;
    }
    
    .app-install-option {
        padding: 16px 18px;
        border-radius: 14px;
    }
    
    .install-icon {
        width: 42px;
        height: 42px;
        margin-right: 16px;
        border-radius: 10px;
    }
    
    .install-text h4 {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .install-text p {
        font-size: 13px;
    }
    
    .download-progress {
        padding: 20px 16px;
    }
    
    .progress-text {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .progress-bar {
        height: 8px;
        margin-bottom: 10px;
    }
    
    .progress-percent {
        font-size: 12px;
    }
    
    .hide-download-section {
        padding: 10px 20px 14px;
    }
    
    .hide-download-btn {
        padding: 6px 14px;
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .hide-download-desc {
        font-size: 11px;
        max-width: 280px;
    }
}

/* 【图片消息功能】: 图片消息样式，与表情包样式保持一致 */
.message.user.image {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    max-width: 80%;
    padding: 8px 12px;
    margin-left: auto;
    flex-direction: row-reverse;
}

.message.ai.image {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    max-width: 80%;
    padding: 8px 12px;
    margin-right: auto;
}

/* 图片消息头像，ai和user分开 */
.message.user.image .message-avatar {
    margin: 0px 0px 10px 10px;
}
.message.ai.image .message-avatar {
    margin: 0px 10px 10px 0px;
}

.message-bubble.image-message {
    background: transparent;
    padding: 0;
    max-width: 280px;
    border-radius: 0;
    overflow: visible;
}

.image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    transition: transform 0.2s ease;
}

.image-container:hover {
    transform: scale(1.1);
}

.chat-image {
    margin: 0px 5px;
    max-width: 200px;
    max-height: 250px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-image:hover {
    opacity: 0.9;
}

.image-description {
    padding: 8px 12px;
    font-size: 14px;
    color: #666;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 12px 12px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* 图片预览模态框样式 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.image-preview-overlay.show {
    display: flex;
}

.image-preview-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: imagePreviewSlideIn 0.3s ease-out;
}

@keyframes imagePreviewSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-preview-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: background-color 0.2s ease;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 1);
}

.image-preview-description {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 版权信息和备案号样式 */
.copyright-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* 设置与底部功能区相似的高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    background-color: #F7F7F7;
    border-top: 1px solid #E0E0E0;
    z-index: 100;
}

.copyright-content {
    display: flex;
    align-items: center;
    gap: 8px; /* 元素间距 */
    padding: 0 20px;
}

.copyright-text,
.icp-text {
    font-size: 12px;
    color: #999999;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap; /* 防止换行 */
}

.separator {
    font-size: 12px;
    color: #ccc;
    margin: 0 4px;
}

.icp-text a {
    color: #999999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-text a:hover {
    color: #666666;
    text-decoration: underline;
}