/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.gpt-page {
    /* 基础布局 - 改为flex，固定头部和底部 */
    height: 100vh;
    overflow: hidden; /* 防止最外层滚动 */
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 16px; /* 移除clamp，使用固定值 */
    padding-top: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box; /* 确保padding计算在内 */

    /* 简化背景，移除复杂渐变 */
    background: #ffffff;
    background: -webkit-linear-gradient(top, #ffffff 0%, #fafafa 100%);
    background: -moz-linear-gradient(top, #ffffff 0%, #fafafa 100%);
    background: -ms-linear-gradient(top, #ffffff 0%, #fafafa 100%);
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    position: relative;
}

/* 移除复杂的伪元素装饰，老版本浏览器支持不好 */

.intro {
    text-align: center;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0; /* 固定在顶部，不压缩 */
}

.intro .logo {
    width: 80px;
    height: 40px;
}

.intro .badge {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 8px 14px;
    -webkit-border-radius: 999px;
    -moz-border-radius: 999px;
    border-radius: 999px;
    background: #f0f6ff;
    background: -webkit-linear-gradient(315deg, #f0f6ff, #f7fff3);
    background: -moz-linear-gradient(315deg, #f0f6ff, #f7fff3);
    background: -ms-linear-gradient(315deg, #f0f6ff, #f7fff3);
    background: linear-gradient(135deg, #f0f6ff, #f7fff3);
    color: #2b5fff;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 10px;
    -webkit-box-shadow: 0 4px 18px rgba(44, 121, 255, 0.12);
    -moz-box-shadow: 0 4px 18px rgba(44, 121, 255, 0.12);
    box-shadow: 0 4px 18px rgba(44, 121, 255, 0.12);
    border: 1px solid rgba(60, 133, 255, 0.18);
}

.intro .badge > * + * {
    margin-left: 8px; /* 替代gap属性 */
}

.intro .badge img {
    width: 18px;
    height: 18px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    display: block;
}

.intro .title {
    margin: 0;
    font-weight: 600;
    letter-spacing: .2px;
    font-size: 24px; /* 移除clamp，使用固定值 */
    color: #111;
    text-shadow: 0 1px 0 #fff;
}

/* 媒体查询替代clamp */
@media (max-width: 768px) {
    .intro .title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .intro .title {
        font-size: 18px;
    }
}

.input-card {
    width: 100%;
    max-width: 1100px; /* 替代min() */
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0; /* 固定在底部，不压缩 */
    /* 简化背景，移除backdrop-filter */
    background: rgba(255,255,255,0.9);
    background: -webkit-linear-gradient(top, rgba(255,255,255,0.75), rgba(255,255,255,0.6));
    background: -moz-linear-gradient(top, rgba(255,255,255,0.75), rgba(255,255,255,0.6));
    background: -ms-linear-gradient(top, rgba(255,255,255,0.75), rgba(255,255,255,0.6));
    background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.6));
    border: 1px solid rgba(24, 26, 33, 0.08);
    -webkit-box-shadow: 0 6px 24px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
    -moz-box-shadow: 0 6px 24px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
    box-shadow: 0 6px 24px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

@media (max-width: 768px) {
    .input-card {
        -webkit-border-radius: 14px;
        -moz-border-radius: 14px;
        border-radius: 14px;
    }
}

.prompt-input {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    font-size: 15px; /* 移除clamp */
    line-height: 1.4;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 8px; /* 移除clamp */
    color: #0b0f1a;
    resize: none;
    /* 自适应高度，允许滚动但隐藏滚动条 */
    height: 48px;
    min-height: 40px;
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    /* 隐藏滚动条的兼容写法 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

@media (max-width: 768px) {
    .prompt-input {
        font-size: 14px;
        padding: 8px 6px;
        height: 42px;
        min-height: 36px;
        max-height: 80px;
    }
}

.prompt-input::placeholder {
    color: #9aa4b2;
}

.prompt-input::-webkit-scrollbar {
    width: 0;
    height: 0;
}

@media (hover: hover) {
    .input-card:hover {
        border-color: rgba(24,26,33,0.12);
        box-shadow:
            0 10px 32px rgba(16, 24, 40, 0.10),
            0 2px 8px rgba(16, 24, 40, 0.06);
    }
}

.prompt-input:focus-visible {
    /* 聚焦时更具质感的高光边框 */
    outline: none;
}

.input-card:focus-within {
    border-color: rgba(43, 95, 255, 0.28);
    box-shadow:
        0 12px 40px rgba(43, 95, 255, 0.18),
        0 2px 10px rgba(16, 24, 40, 0.06);
}

/* 深色模式适配（若页面存在） */
@media (prefers-color-scheme: dark) {
    .gpt-page {
        background: radial-gradient(1200px 600px at 50% -10%, #0f1320 0%, #0b0f15 55%),
                    linear-gradient(180deg, #0b0f15 0%, #0b0f13 100%);
    }
    .intro .title { color: #e6e9ef; text-shadow: none; }
    .intro .badge {
        background: linear-gradient(135deg, rgba(34, 64, 120, .35), rgba(30, 60, 20, .35));
        color: #cddcff;
        border-color: rgba(120, 160, 255, .25);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
    }
    .input-card {
        background: linear-gradient(180deg, rgba(22, 24, 29, 0.68), rgba(22, 24, 29, 0.54));
        border-color: rgba(255,255,255,0.06);
        box-shadow:
            0 10px 30px rgba(0, 0, 0, 0.45),
            0 1px 2px rgba(0, 0, 0, 0.35);
    }
    .input-card:hover { border-color: rgba(120, 160, 255, .24); }
    .input-card:focus-within {
        border-color: rgba(120, 160, 255, .4);
        box-shadow: 0 16px 46px rgba(60, 120, 255, 0.22);
    }
    .prompt-input { color: #e6e9ef; }
    .prompt-input::placeholder { color: #7f8aa3; }
}

/* 聊天区样式 - 自适应高度 */
.chat-wrapper {
    width: 100%;
    max-width: 1100px; /* 替代min() */
    /* 自适应高度，占据剩余空间 */
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-height: 0; /* 允许完全收缩 */
    overflow-y: auto; /* 只允许垂直滚动 */
    overflow-x: hidden; /* 隐藏水平滚动 */
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    padding:2px 6px 6px 8px; /* 移除clamp */
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.6);
    -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
    -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
    /* 修复移动端滚动消失问题 */
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
}

@media (max-width: 768px) {
    .chat-wrapper {
        padding: 6px 4px;
        -webkit-border-radius: 14px;
        -moz-border-radius: 14px;
        border-radius: 14px;
    }
}

.chat-wrapper::-webkit-scrollbar { /* Chrome/Safari */
    width: 0;
    height: 0;
}

.msg {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
    padding: 2px 8px;
    position: relative;
}

.msg > * + * {
    margin-left: 10px; /* 替代gap */
}

/* 用户消息右对齐 */
.msg.user {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -webkit-flex-direction: row-reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
}

.msg.user > * + * {
    margin-left: 0;
    margin-right: 10px;
}

.msg .avatar {
    width: 32px;
    height: 32px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    background: #eef2ff;
    color: #2b5fff;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    -webkit-flex: none;
    -ms-flex: none;
    flex: none;
}

.msg .avatar img { 
    width: 100%; 
    height: 100%; 
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.msg .bubble {
    /* 改为自适应宽度，不再占满 */
    -webkit-flex: none;
    -ms-flex: none;
    flex: none;
    max-width: 70%;
    min-width: 80px;
    width: auto; /* 替代fit-content */
    -webkit-border-radius: 14px;
    -moz-border-radius: 14px;
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid rgba(24,26,33,0.08);
    -webkit-box-shadow: 0 2px 10px rgba(16,24,40,0.04);
    -moz-box-shadow: 0 2px 10px rgba(16,24,40,0.04);
    box-shadow: 0 2px 10px rgba(16,24,40,0.04);
    position: relative;
    z-index: 1;
    height: auto;
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1);
}

.uploaded-image {
    max-width: 200px !important;
    margin-bottom: 12px !important;
}

.msg.user .bubble { 
    background: #f7fbff; 
}

.markdown {
    font-size: 14px;
    line-height: 1.75;
    color: #0b0f1a;
}

.markdown img {
    max-width: 150px !important;
    margin-bottom: 12px !important;
}

.uploaded-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.markdown h1, .markdown h2, .markdown h3, .markdown h4 { 
    margin: .6em 0 .4em; 
}

.markdown pre.code { 
    background: #0f172a; 
    color: #e5edf7; 
    padding: 10px 12px; 
    border-radius: 10px; 
    overflow: auto; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

.markdown pre.code::-webkit-scrollbar { 
    width: 0; 
    height: 0; 
}

.markdown code.inline-code { 
    background: #eef2ff; 
    padding: 2px 6px; 
    border-radius: 6px; 
}

.composer {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    width: 100%;
    max-width: 1100px; /* 替代min() */
    height: auto;
    padding: 4px; /* 替代1vw */
    /* 安卓端键盘适配 */
    position: relative;
    z-index: 1000;
}

.composer > * + * {
    margin-top: 2px; /* 替代gap */
}

@media (max-width: 768px) {
    .composer {
        padding: 2px;
        width:90%;
    }
}

.input-wrapper {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: end;
    -webkit-align-items: flex-end;
    -ms-flex-align: end;
    align-items: flex-end;
    width: 100%;
    height: auto;
}

.toolbar {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.toolbar > * + * {
    margin-left: 4px; /* 替代gap */
}

.tool-btn {
    border: none;
    background: rgba(255,255,255,0.8);
    color: #666;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -ms-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    font-size: 16px;
}

.tool-btn:hover {
    background: rgba(255,255,255,1);
    border-color: rgba(24,26,33,0.2);
    color: #333;
}

.image-preview {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    padding: 2px; /* 移除clamp */
    background: rgba(255,255,255,0.5);
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    border: 1px dashed rgba(24,26,33,0.1);
}

.image-preview > * + * {
    margin-left: 8px; /* 替代gap */
}

@media (max-width: 768px) {
    .image-preview {
        padding: 6px;
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        border-radius: 10px;
    }
    
    .image-preview > * + * {
        margin-left: 6px;
    }
}

.preview-item {
    position: relative;
    width: 50px; /* 移除clamp */
    height: 50px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(24,26,33,0.1);
}

@media (max-width: 768px) {
    .preview-item {
        width: 45px;
        height: 45px;
        -webkit-border-radius: 6px;
        -moz-border-radius: 6px;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .preview-item {
        width: 40px;
        height: 40px;
    }
}

.preview-item img {
    width: 100%;
    height: 100%;
    /* object-fit在老版本浏览器中不支持，移除 */
}

.remove-btn {
    position: absolute;
    top: -1px; /* 移除clamp */
    right: -1px;
    width: 18px;
    height: 18px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .remove-btn {
        top: -4px;
        right: -4px;
        width: 16px;
        height: 16px;
        font-size: 11px;
    }
}

.remove-btn:hover {
    background: #ff3742;
}

/* 上传状态样式 */
.preview-item.uploading {
    opacity: 0.7;
}

.uploading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.uploading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.uploading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 102, 102, 0.3);
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.tool-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.thinking-text {
    font-size: 14px;
    line-height: 1.75;
    color: #666;
    font-style: italic;
}

.composer.loading { 
    opacity: .8; 
    pointer-events: none; 
}

.send-btn {
    height: 36px; /* 移除clamp */
    padding: 0 12px;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    border: 1px solid rgba(24,26,33,0.12);
    background: #ffffff;
    background: -webkit-linear-gradient(top, #ffffff, #f7f7f9);
    background: -moz-linear-gradient(top, #ffffff, #f7f7f9);
    background: -ms-linear-gradient(top, #ffffff, #f7f7f9);
    background: linear-gradient(180deg, #ffffff, #f7f7f9);
    -webkit-box-shadow: 0 2px 8px rgba(16,24,40,.06);
    -moz-box-shadow: 0 2px 8px rgba(16,24,40,.06);
    box-shadow: 0 2px 8px rgba(16,24,40,.06);
    color: #1f3a93;
    font-weight: 600;
    font-size: 14px;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -ms-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .send-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 13px;
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        border-radius: 10px;
    }
}

.send-btn:disabled { 
    opacity: .5; 
    cursor: not-allowed;
}

.send-btn:hover:not(:disabled) {
    background: #f8f9fa;
    background: -webkit-linear-gradient(top, #f8f9fa, #e9ecef);
    background: -moz-linear-gradient(top, #f8f9fa, #e9ecef);
    background: -ms-linear-gradient(top, #f8f9fa, #e9ecef);
    background: linear-gradient(180deg, #f8f9fa, #e9ecef);
    -webkit-box-shadow: 0 4px 12px rgba(16,24,40,.1);
    -moz-box-shadow: 0 4px 12px rgba(16,24,40,.1);
    box-shadow: 0 4px 12px rgba(16,24,40,.1);
}

/* 打字机效果 & typing 指示器 */
.bubble.typing {
    position: relative;
}

.typing-indicator {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-top: 8px;
    opacity: 0.6;
}

.typing-indicator > * + * {
    margin-left: 4px; /* 替代gap */
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    background: #9aa4b2;
    -webkit-animation: typing-dot 1.4s infinite ease-in-out;
    -moz-animation: typing-dot 1.4s infinite ease-in-out;
    -ms-animation: typing-dot 1.4s infinite ease-in-out;
    animation: typing-dot 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    -webkit-animation-delay: 0.2s;
    -moz-animation-delay: 0.2s;
    -ms-animation-delay: 0.2s;
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    -webkit-animation-delay: 0.4s;
    -moz-animation-delay: 0.4s;
    -ms-animation-delay: 0.4s;
    animation-delay: 0.4s;
}

@-webkit-keyframes typing-dot {
    0%, 60%, 100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        -webkit-transform: translateY(-8px);
        transform: translateY(-8px);
        opacity: 1;
    }
}

@-moz-keyframes typing-dot {
    0%, 60%, 100% {
        -moz-transform: translateY(0);
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        -moz-transform: translateY(-8px);
        transform: translateY(-8px);
        opacity: 1;
    }
}

@keyframes typing-dot {
    0%, 60%, 100% {
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        -ms-transform: translateY(0);
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        -webkit-transform: translateY(-8px);
        -moz-transform: translateY(-8px);
        -ms-transform: translateY(-8px);
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* 优化消息气泡样式 */
.msg {
    opacity: 1;
}

.msg.user .bubble {
    background: #f0f6ff;
    background: -webkit-linear-gradient(315deg, #f0f6ff, #ffffff);
    background: -moz-linear-gradient(315deg, #f0f6ff, #ffffff);
    background: -ms-linear-gradient(315deg, #f0f6ff, #ffffff);
    background: linear-gradient(135deg, #f0f6ff, #ffffff);
    border: 1px solid rgba(43, 95, 255, 0.12);
}

.msg.assistant .bubble {
    background: #ffffff;
    background: -webkit-linear-gradient(315deg, #ffffff, #fafbff);
    background: -moz-linear-gradient(315deg, #ffffff, #fafbff);
    background: -ms-linear-gradient(315deg, #ffffff, #fafbff);
    background: linear-gradient(135deg, #ffffff, #fafbff);
    border: 1px solid rgba(24, 26, 33, 0.08);
}

/* 暗色模式优化 */
@media (prefers-color-scheme: dark) {
    .msg.user .bubble {
        background: rgba(43, 95, 255, 0.15);
        background: -webkit-linear-gradient(315deg, rgba(43, 95, 255, 0.15), rgba(22, 24, 29, 0.8));
        background: -moz-linear-gradient(315deg, rgba(43, 95, 255, 0.15), rgba(22, 24, 29, 0.8));
        background: -ms-linear-gradient(315deg, rgba(43, 95, 255, 0.15), rgba(22, 24, 29, 0.8));
        background: linear-gradient(135deg, rgba(43, 95, 255, 0.15), rgba(22, 24, 29, 0.8));
        border-color: rgba(120, 160, 255, .2);
    }
    
    .msg.assistant .bubble {
        background: rgba(22, 24, 29, 0.9);
        background: -webkit-linear-gradient(315deg, rgba(22, 24, 29, 0.9), rgba(30, 32, 38, 0.8));
        background: -moz-linear-gradient(315deg, rgba(22, 24, 29, 0.9), rgba(30, 32, 38, 0.8));
        background: -ms-linear-gradient(315deg, rgba(22, 24, 29, 0.9), rgba(30, 32, 38, 0.8));
        background: linear-gradient(135deg, rgba(22, 24, 29, 0.9), rgba(30, 32, 38, 0.8));
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .typing-indicator span {
        background: #7f8aa3;
    }
    
    .markdown { 
        color: #e6e9ef; 
    }
    
    .uploaded-image {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .chat-wrapper {
        background: rgba(22, 24, 29, 0.6);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
    }
    
    .send-btn {
        background: rgba(255,255,255,0.1);
        background: -webkit-linear-gradient(top, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
        background: -moz-linear-gradient(top, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
        background: -ms-linear-gradient(top, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
        background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
        color: #e6e9ef;
        border-color: rgba(255,255,255,0.1);
    }
    
    .send-btn:hover:not(:disabled) {
        background: rgba(255,255,255,0.15);
        background: -webkit-linear-gradient(top, rgba(255,255,255,0.15), rgba(255,255,255,0.1));
        background: -moz-linear-gradient(top, rgba(255,255,255,0.15), rgba(255,255,255,0.1));
        background: -ms-linear-gradient(top, rgba(255,255,255,0.15), rgba(255,255,255,0.1));
        background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.1));
    }
    
    .tool-btn {
        background: rgba(255,255,255,0.1);
        color: #e6e9ef;
    }
    
    .tool-btn:hover {
        background: rgba(255,255,255,0.2);
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .gpt-page {
        padding: 8px;
        /* padding-top: 50px; */
    }
    
    .msg .bubble {
        max-width: 85%;
    }
    
    .intro .logo {
        width: 60px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .msg .bubble {
        max-width: 90%;
    }
    
    .input-wrapper {
        gap: 4px;
    }
    
    .toolbar {
        gap: 2px;
    }
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .prompt-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}