* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: rgb(245, 235, 210);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.sidebar {
    width: 120px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(200, 40, 60, 0.1);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar h3 {
    font-size: 14px;
    color: rgb(35, 30, 25);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.platform-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.platform-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s;
}

.platform-links a:hover {
    transform: translateY(-3px);
}

.platform-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    margin-bottom: 6px;
    transition: box-shadow 0.2s;
}

.platform-img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 6px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.platform-links a:hover .platform-icon,
.platform-links a:hover .platform-img {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.platform-icon.doubao {
    background: linear-gradient(135deg, rgb(59, 130, 246), rgb(37, 99, 235));
}

.platform-icon.deepseek {
    background: linear-gradient(135deg, rgb(14, 165, 233), rgb(2, 132, 199));
    font-size: 11px;
}

.platform-icon.chatgpt {
    background: linear-gradient(135deg, rgb(16, 185, 129), rgb(5, 150, 105));
    font-size: 10px;
}

.platform-icon.gemini {
    background: linear-gradient(135deg, rgb(245, 158, 11), rgb(217, 119, 6));
}

.platform-links span {
    font-size: 11px;
    color: rgb(107, 114, 128);
    font-weight: 500;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(200, 40, 60, 0.12);
    overflow: hidden;
}

.header {
    background: rgb(200, 40, 60);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.config-section {
    padding: 20px 30px;
    background: rgb(252, 250, 248);
    border-bottom: 1px solid rgb(230, 225, 220);
}

.config-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 15px;
}

.config-toggle h3 {
    color: rgb(35, 30, 25);
    font-size: 16px;
}

.config-toggle .arrow {
    transition: transform 0.3s;
    font-size: 12px;
    color: rgb(230, 225, 220);
}

.config-toggle.active .arrow {
    transform: rotate(180deg);
}

.config-form {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.config-form.show {
    display: grid;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    color: rgb(35, 30, 25);
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input {
    padding: 10px 12px;
    border: 2px solid rgb(230, 225, 220);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: white;
    color: rgb(35, 30, 25);
}

.form-group input:focus {
    outline: none;
    border-color: rgb(200, 40, 60);
}

.form-group input::placeholder {
    color: rgb(180, 175, 170);
}

.chat-section {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    background: #fff;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-content {
    background: rgb(200, 40, 60);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai .message-content {
    background: rgb(252, 250, 248);
    color: rgb(35, 30, 25);
    border-bottom-left-radius: 4px;
    border: 1px solid rgb(230, 225, 220);
}

.message.ai .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgb(225, 180, 70);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(35, 30, 25);
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.typing-indicator {
    display: none;
    align-items: center;
    padding: 12px 16px;
    background: rgb(252, 250, 248);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid rgb(230, 225, 220);
}

.typing-indicator.show {
    display: flex;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgb(200, 40, 60);
    border-radius: 50%;
    margin: 0 2px;
    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(-10px);
    }
}

.input-section {
    padding: 20px 30px;
    background: rgb(252, 250, 248);
    border-top: 1px solid rgb(230, 225, 220);
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

.input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgb(230, 225, 220);
    border-radius: 25px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: white;
    color: rgb(35, 30, 25);
}

.input-wrapper input:focus {
    outline: none;
    border-color: rgb(200, 40, 60);
}

.input-wrapper input::placeholder {
    color: rgb(180, 175, 170);
}

.input-wrapper button {
    padding: 12px 24px;
    background: rgb(200, 40, 60);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.input-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(200, 40, 60, 0.25);
}

.input-wrapper button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-message {
    color: rgb(200, 40, 60);
    font-size: 12px;
    margin-top: 10px;
    display: none;
}

.error-message.show {
    display: block;
}

.welcome-message {
    text-align: center;
    color: rgb(230, 225, 220);
    padding: 40px 20px;
}

.welcome-message h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: rgb(35, 30, 25);
}

.welcome-message p {
    font-size: 14px;
}

.footer {
    padding: 15px 30px;
    background: rgb(252, 250, 248);
    border-top: 1px solid rgb(230, 225, 220);
    text-align: center;
}

.footer p {
    font-size: 11px;
    color: rgb(150, 145, 140);
    margin: 4px 0;
    line-height: 1.4;
}

@media (max-width: 1100px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-width: 900px;
        flex-direction: row;
        justify-content: center;
        padding: 15px;
    }
    
    .sidebar h3 {
        margin-bottom: 0;
        margin-right: 20px;
    }
    
    .platform-links {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}
