* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

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

header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.output-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.message.user {
    flex-direction: row-reverse;
}

.message.user .content {
    background: #3498db;
    color: white;
    border-top-right-radius: 0;
    border-top-left-radius: 15px;
    align-items: flex-end;
}

.message.system .content {
    background: white;
    color: #333;
    border-top-left-radius: 0;
    border-top-right-radius: 15px;
    border: 1px solid #e9ecef;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin: 0 15px;
}

.message.user .avatar {
    background: #3498db;
    color: white;
}

.message.system .avatar {
    background: #2c3e50;
    color: white;
}

.content {
    max-width: 70%;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.text {
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.time {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
}

.input-area {
    padding: 25px;
    background: white;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.input-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1c6ea4 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.info {
    background: #e8f4fc;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.info p {
    color: #2c3e50;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    border-top: 1px solid #e9ecef;
}

footer p {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

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

.output-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.output-area::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.output-area::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        border-radius: 15px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .content {
        max-width: 85%;
    }
    
    .chat-container {
        height: 500px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 打字机效果 */
.typing {
    display: inline-block;
}

.typing::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}