:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-yellow: #ffd700;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --border-color: #333333;
    --message-user-bg: #2d3748;
    --message-assistant-bg: #1a365d;
    --typing-dot-color: var(--accent-blue);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Header Styles */
.hero {
    text-align: center;
    padding: 1rem 0;
    flex-shrink: 0;
}

.hero h1 {
    font-size: 2rem;
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
}

.hero h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.hero .author {
    font-size: 0.9rem;
    color: var(--accent-yellow);
    margin-bottom: 1rem;
    font-style: italic;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.badge.badge-purple, .badge.badge-accent, .badge.badge-green {
    font-weight: 500;
}

.badge.badge-purple {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border-color: rgba(139, 92, 246, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

.badge.badge-accent {
    background-color: rgba(236, 72, 153, 0.15);
    color: #ec4899;
    border-color: rgba(236, 72, 153, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(236, 72, 153, 0.1);
}

.badge.badge-green {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.badge-yellow {
    background-color: rgba(255, 215, 0, 0.1);
    color: var(--accent-yellow);
    border-color: rgba(255, 215, 0, 0.3);
}

.badge-blue {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Badge Link Styles */
.badge.badge-purple:hover {
    transform: translateY(-3px) rotate(-2deg);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    background-color: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-purple);
}

.badge.badge-purple:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.badge.badge-accent:hover {
    transform: translateY(-3px) rotate(2deg);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    background-color: rgba(236, 72, 153, 0.2);
    border-color: #ec4899;
}

.badge.badge-accent:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

/* Message Styles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    padding: 1rem;
    border-radius: 1rem;
    animation: fadeIn 0.3s ease;
}

.message.user {
    background-color: var(--message-user-bg);
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.message.assistant {
    background-color: var(--message-assistant-bg);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.message .content {
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.message .timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    align-self: flex-end;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--message-assistant-bg);
    border-radius: 1rem;
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    animation: fadeIn 0.3s ease;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--typing-dot-color);
    border-radius: 50%;
    opacity: 0.3;
}

.typing-dot:nth-child(1) { animation: typingDot 1s infinite 0s; }
.typing-dot:nth-child(2) { animation: typingDot 1s infinite 0.2s; }
.typing-dot:nth-child(3) { animation: typingDot 1s infinite 0.4s; }

/* Input Container */
.chat-input-container {
    padding: 1rem;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.message-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    max-height: 150px;
    transition: all 0.3s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.send-button {
    padding: 0.75rem;
    background-color: var(--accent-blue);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    background-color: #2563eb;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Controls */
.chat-controls {
    display: flex;
    gap: 0.75rem;
}

.model-select {
    flex: 1;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.model-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.clear-button {
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-button:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

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

@keyframes typingDot {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Scrollbar Styles */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero h2 {
        font-size: 1rem;
    }

    .message {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .chat-controls {
        flex-direction: column;
    }

    .clear-button {
        text-align: center;
    }
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 4px;
    display: none;
    min-width: 120px;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .language-selector {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }

    .language-btn {
        padding: 4px 8px;
        font-size: 12px;
        background: rgba(0, 0, 0, 0.6);
    }

    .language-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        width: auto;
        min-width: 100px;
    }

    .hero {
        padding-top: 2.5rem;
        padding-bottom: 0.5rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero h2 {
        font-size: 0.9rem;
    }

    .badges {
        padding-top: 0.5rem;
    }
}

/* 小屏幕进一步优化 */
@media (max-width: 480px) {
    .language-btn {
        padding: 4px 6px;
        font-size: 11px;
    }

    .globe-icon {
        font-size: 14px;
    }

    .language-dropdown {
        min-width: 90px;
    }

    .language-option {
        padding: 6px 8px;
        font-size: 11px;
    }
} 