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

body { 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; 
    background: radial-gradient(at 0% 0%, #0a192f 0px, transparent 50%),
                radial-gradient(at 100% 0%, #0f2e54 0px, transparent 50%),
                radial-gradient(at 100% 100%, #1a365d 0px, transparent 50%),
                radial-gradient(at 0% 100%, #020617 0px, transparent 50%),
                #020617;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    color: #1d1d1f; 
    overflow: hidden;
}

/* 💬 聊天主体容器（提高底色浓度，完美遮挡并折射背后的底层星星） */
.chat-container { 
    width: 100%; 
    max-width: 1000px; 
    height: 90vh; 
    /* 调整为 0.85 的不透明度，这样能遮挡住底层划过的星星，产生完美的物理分层感 */
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(30px); 
    -webkit-backdrop-filter: blur(30px);
    border-radius: 28px; 
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5),
                0 10px 30px rgba(0, 0, 0, 0.3); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    border: 1px solid rgba(255, 255, 255, 0.5); 
    display: none; 
}

/* 顶部导航 */
.chat-header { 
    background: rgba(255, 255, 255, 0.3); 
    color: #0f172a; 
    padding: 22px 28px; 
    font-size: 16px; 
    font-weight: 600; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); 
}
.chat-header-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.clear-btn { 
    background: rgba(0, 0, 0, 0.06); 
    color: #1e293b; 
    border: none; 
    padding: 6px 14px; 
    border-radius: 14px; 
    cursor: pointer; 
    font-size: 12px; 
    font-weight: 500; 
    transition: all 0.2s; 
}
.clear-btn:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* 消息展示区域 */
.chat-messages { 
    flex: 1; 
    padding: 28px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 22px; 
    background: transparent; 
}
.message { 
    max-width: 82%; 
    padding: 14px 20px; 
    border-radius: 20px; 
    font-size: 15px; 
    line-height: 1.6; 
    word-break: break-all; 
}
.user-message { 
    background: #1e40af; 
    color: white; 
    align-self: flex-end; 
    border-bottom-right-radius: 4px; 
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.3); 
    white-space: pre-wrap;
}
.ai-message { 
    background: rgba(255, 255, 255, 0.9); 
    color: #0f172a; 
    align-self: flex-start; 
    border-bottom-left-radius: 4px; 
    border: 1px solid rgba(255, 255, 255, 0.6); 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* ==========================================
   Markdown 内嵌格式美化样式
   ========================================== */
.ai-message p { margin-bottom: 8px; }
.ai-message p:last-child { margin-bottom: 0; }
.ai-message ol, .ai-message ul { margin-left: 20px; margin-bottom: 8px; }
.ai-message li { margin-bottom: 4px; }
.ai-message h1, .ai-message h2, .ai-message h3 { font-size: 1.15rem; font-weight: 600; margin: 14px 0 8px 0; color: #000; }
.ai-message table { width: 100%; border-collapse: collapse; margin: 12px 0; background: rgba(255,255,255,0.6); border-radius: 8px; overflow: hidden; font-size: 14px; }
.ai-message th, .ai-message td { border: 1px solid rgba(0,0,0,0.06); padding: 8px 12px; text-align: left; }
.ai-message th { background: rgba(0,0,0,0.04); font-weight: 600; }
.ai-message :not(pre) > code { background: rgba(0, 0, 0, 0.06); color: #c7254e; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 14px; }
.code-block-wrapper { position: relative; margin: 12px 0; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.ai-message pre { margin: 0; background: #0d1117 !important; padding: 16px; overflow-x: auto; }
.ai-message pre code { font-family: "Fira Code", Consolas, Monaco, monospace; font-size: 14px; background: transparent !important; padding: 0; color: #c9d1d9; }
.copy-code-btn { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); color: #8b949e; padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.2s; backdrop-filter: blur(4px); }
.copy-code-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; border-color: rgba(255, 255, 255, 0.4); }

/* 输入区域 */
.chat-input-wrapper { padding: 20px 28px 24px 28px; background: rgba(255, 255, 255, 0.15); border-top: 1px solid rgba(0, 0, 0, 0.05); }
.chat-input-area { display: flex; background: rgba(255, 255, 255, 0.85); border-radius: 24px; padding: 8px 8px 8px 18px; align-items: flex-end; gap: 12px; border: 1px solid rgba(0, 0, 0, 0.06); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02); transition: all 0.2s; }
.chat-input-area:focus-within { background: #ffffff; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 213, 0.15); }
textarea { flex: 1; height: 24px; max-height: 120px; border: none; background: transparent; resize: none; font-size: 15px; outline: none; color: #0f172a; line-height: 24px; padding: 0; }
textarea::placeholder { color: #94a3b8; }

button.send-btn { background: #2563eb; color: white; border: none; border-radius: 18px; width: 36px; height: 36px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.2s; font-size: 14px; box-shadow: 0 4px 12px rgba(37, 99, 213, 0.25); flex-shrink: 0; margin-bottom: 2px; }
button.send-btn:hover { background: #1d4ed8; transform: scale(1.05); }
button:disabled { background: rgba(0, 0, 0, 0.08) !important; color: #94a3b8 !important; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* 密码验证区域 */
.auth-container { text-align: center; background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); padding: 44px 36px; border-radius: 28px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4); width: 90%; max-width: 380px; border: 1px solid rgba(255, 255, 255, 0.4); }
.auth-container h2 { margin-bottom: 24px; font-size: 19px; color: #0f172a; font-weight: 600; }
.auth-container input { width: 100%; padding: 14px; border: 1px solid rgba(0,0,0,0.08); border-radius: 14px; margin-bottom: 18px; font-size: 16px; outline: none; text-align: center; background: rgba(255,255,255,0.6); transition: all 0.2s; color: #0f172a; }
.auth-container input:focus { background: #ffffff; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 213, 0.15); }
.auth-container button { width: 100%; background: #2563eb; color: white; border: none; padding: 14px; border-radius: 14px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(37, 99, 213, 0.2); }
.auth-container button:hover { background: #1d4ed8; transform: scale(1.02); }


/* ==========================================
   🎨 AI 生成图片（Nano Banana 2）专属高级美化
   ========================================== */
.generated-image-container {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* 赋予生成的图片平滑圆角、微光外边框与悬浮阴影，并支持悬浮手势 */
.ai-generated-img {
    max-width: 100%;
    max-height: 450px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    cursor: zoom-in; /* 提醒用户点击可以放大 */
    transition: transform 0.2s ease;
}

.ai-generated-img:hover {
    transform: scale(1.01); /* 鼠标悬停时轻微放大增添交互感 */
}

/* 图片下方的精致小标签 */
.generated-image-tip {
    font-size: 12px;
    color: #86868b;
    margin-left: 4px;
    font-style: italic;
}