:root {
    --bg-color: #131314;
    --sidebar-bg: #1e1f20;
    --sidebar-hover: #333537;
    --text-color: #e3e3e3;
    --text-muted: #8e918f;
    --input-bg: #1e1f20;
    --card-bg: #1e1f20;
    --card-hover: #282a2c;
    --accent-color: #4b90ff;
    --border-color: #444746;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Google Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 68px;
}

.sidebar.collapsed .text, 
.sidebar.collapsed .recent-title {
    display: none;
}

.sidebar-top {
    margin-bottom: 32px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    margin-bottom: 20px;
}

.menu-btn:hover {
    background-color: var(--sidebar-hover);
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #282a2c;
    border: none;
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 24px;
    cursor: pointer;
    width: fit-content;
    transition: background-color 0.2s;
}

.sidebar.collapsed .new-chat-btn {
    padding: 10px;
}

.new-chat-btn:hover {
    background-color: var(--sidebar-hover);
}

.sidebar-middle {
    flex: 1;
    overflow-y: auto;
}

.recent-title {
    font-size: 14px;
    margin: 20px 12px 10px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 24px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
}

.history-item:hover {
    background-color: var(--sidebar-hover);
}

.history-item.active {
    background-color: #37393b;
}

.sidebar-bottom {
    margin-top: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
}

/* 主聊天区域 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gemini-logo {
    font-size: 20px;
    font-weight: 500;
}

.model-select {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--sidebar-hover);
}

/* 欢迎屏幕 */
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
}

.welcome-screen {
    margin-top: 8vh;
    max-width: 800px;
    align-self: center;
    width: 100%;
}

.welcome-text {
    font-size: 56px;
    font-weight: 500;
    background: linear-gradient(to right, #4b90ff, #ff5546);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.sub-text {
    font-size: 56px;
    font-weight: 500;
    color: #444746;
    margin-bottom: 40px;
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-color 0.2s;
}

.card:hover {
    background-color: var(--card-hover);
}

.card p {
    font-size: 16px;
    line-height: 1.5;
}

/* 图标字体基础样式优化 */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    /* 核心修复：确保在字体加载前不显示乱码或原始文字 */
    font-variant-ligatures: discretionary-ligatures;
    letter-spacing: -1em; /* 新增：将所有字母重叠在一起，彻底隐藏单词 */
    overflow: hidden;
    width: 24px;
    height: 24px;
}

.card-icon {
    align-self: flex-end;
    background-color: var(--bg-color);
    padding: 8px;
    border-radius: 50%;
    width: 40px; /* 包含 padding 的大小 */
    height: 40px;
}

/* 输入区域 */
.input-area {
    padding: 20px 24px 40px;
    max-width: 800px;
    width: 100%;
    align-self: center;
}

/* 选项按钮样式 */
.choice-pills {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.choice-pill {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.choice-pill:hover {
    background-color: rgba(75, 144, 255, 0.1);
    border-color: var(--accent-color);
}
    padding: 20px 24px 30px;
    max-width: 800px;
    width: 100%;
    align-self: center;
}

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

.input-wrapper {
    background-color: var(--input-bg);
    border-radius: 32px;
    padding: 8px 12px 8px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-wrapper:focus-within {
    background-color: #282a2c;
}

textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    resize: none;
    outline: none;
    padding: 12px 0;
    max-height: 200px;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.send-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background-color: var(--sidebar-hover);
}

.send-btn.active {
    color: var(--accent-color);
}

.disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* 消息样式 */
.message-list {
    max-width: 800px;
    width: 100%;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-bottom: 100px; /* 为输入框留出空间 */
}

.message {
    display: flex;
    gap: 24px;
    animation: fadeIn 0.4s ease;
}

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

.message-wrapper {
    display: flex;
    gap: 24px;
    width: 100%;
}

.avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

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

.gemini-icon {
    color: var(--accent-color);
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.text-content {
    line-height: 1.6;
    font-size: 16px;
    color: var(--text-color);
    padding-top: 4px;
}

.message.gemini .text-content {
    color: #e3e3e3;
}

/* 代码块样式 */
.code-block {
    background-color: #000000;
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background-color: #282a2c;
    font-size: 12px;
    color: var(--text-muted);
}

.code-content {
    padding: 16px;
    overflow-x: auto;
}

pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #e3e3e3;
}

/* 数学公式简易样式 */
.math {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    padding: 0 2px;
}

.math-block {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Consolas", monospace;
    font-style: normal;
}

/* 刻晴背景样式 */
.keqing-theme .chat-container {
    background-image: linear-gradient(rgba(19, 19, 20, 0.7), rgba(19, 19, 20, 0.7)), url('keqing.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.keqing-theme .sidebar {
    background-color: var(--sidebar-bg); /* 保持侧边栏原样，不被背景覆盖 */
}

body.keqing-theme .chat-container .card,
body.keqing-theme .chat-container .input-wrapper {
    background-color: rgba(30, 31, 32, 0.6);
    backdrop-filter: blur(8px);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #444746;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .welcome-text, .sub-text {
        font-size: 32px;
    }
    
    .suggestion-cards {
        grid-template-columns: 1fr 1fr;
    }
}
