* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: url('pic.jpg') no-repeat center center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #1f2937;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    background: transparent;
}

.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    border-radius: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.new-chat-btn {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-item {
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 4px;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-item.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 500;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.welcome-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: transparent;
    border-radius: 0;
    margin: 0;
}

.welcome-section.hidden {
    display: none;
}

.welcome-icon {
    display: none;
}

.welcome-section h2 {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.welcome-section p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 600px;
}

.suggestion-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s;
}

.suggestion-card:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.suggestion-card svg {
    color: #ffffff;
    flex-shrink: 0;
}

.suggestion-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-text strong {
    font-size: 15px;
    color: #ffffff;
}

.suggestion-text span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.messages-container {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.messages-container.hidden {
    display: none;
}

.message {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.user-message .message-avatar {
    background: #111827;
    color: #ffffff;
}

.message-content {
    flex: 1;
    min-width: 0;
    max-width: 720px;
}

.user-message .message-content {
    display: flex;
    justify-content: flex-end;
}

.message-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    line-height: 1.7;
    font-size: 15px;
    color: #ffffff;
}

.user-message .message-content {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

.thinking-content {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    padding: 16px 20px;
}

.thinking-text {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.thinking-dots {
    animation: thinkingDots 1.5s infinite;
}

@keyframes thinkingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

.thinking-dots::after {
    content: '';
    animation: thinkingDotsAfter 1.5s infinite;
}

@keyframes thinkingDotsAfter {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

.thinking-animation {
    display: flex;
    gap: 2px;
    padding: 16px 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.thinking-animation span {
    animation: thinkingBounce 1.4s infinite;
}

.thinking-animation span:nth-child(1) { animation-delay: 0s; }
.thinking-animation span:nth-child(2) { animation-delay: 0.1s; }
.thinking-animation span:nth-child(3) { animation-delay: 0.2s; }
.thinking-animation span:nth-child(4) { animation-delay: 0.3s; }
.thinking-animation span:nth-child(5) { animation-delay: 0.4s; }
.thinking-animation span:nth-child(6) { animation-delay: 0.5s; }

@keyframes thinkingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

.input-area {
    padding: 20px 24px 28px;
    background: transparent;
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 14px 18px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.4);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 200px;
    line-height: 1.6;
    background: transparent;
    color: #ffffff;
}

#messageInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.4);
}

.send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

.input-hint {
    max-width: 900px;
    margin: 12px auto 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.message-content table th,
.message-content table td {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 12px;
    text-align: left;
}

.message-content table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: #ffffff;
}

.message-content table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.message-content table tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    color: #ffffff;
}

.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 18px; }
.message-content h3 { font-size: 16px; }

.message-content ul,
.message-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.message-content li {
    margin: 6px 0;
    color: #ffffff;
}

.message-content strong {
    color: #ffffff;
    font-weight: 600;
}

.message-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: #ffffff;
}

/* 滚动条毛玻璃效果 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.1);
}

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }

    .message-content {
        max-width: 100%;
    }
}
