:root {
    --primary-color: #1a2a6c;
    --secondary-color: #b21f1f;
    --bg-gradient: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --white: #ffffff;
}

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

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 容器与APP布局 */
.container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    margin: 0 20px;
}

.app {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 头部样式 */
.chat-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 聊天内容区 */
.chat-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.message.ai {
    align-self: flex-start;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.message.user .avatar { background: var(--secondary-color); }
.message.ai .avatar { background: var(--primary-color); }

.message-content {
    background: white;
    padding: 12px 18px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    line-height: 1.5;
    font-size: 0.95rem;
    color: #333;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

/* 输入区域 */
.input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.input-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

/* 深度思考开关 */
.toggle-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-container input {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #555;
    padding: 6px 12px;
    border-radius: 20px;
    background: #f0f0f0;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.toggle-container input:checked + .toggle-label {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
    font-weight: 600;
}

/* 字数统计 */
.char-count {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

textarea {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    resize: none;
    outline: none;
    font-size: 1rem;
    max-height: 150px;
    transition: border-color 0.3s;
}

textarea:focus {
    border-color: var(--primary-color);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.1s;
}

.send-btn:hover {
    background: #0d1b40;
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 登录模态框样式 */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    text-align: center;
}

.auth-header h2 {
    color: #333;
    margin-bottom: 5px;
}

.auth-header p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.auth-switch {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

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

/* 响应式 */
@media (max-width: 600px) {
    .container { margin: 0; height: 100vh; border-radius: 0; }
    .app { border-radius: 0; height: 100%; }
    .message { max-width: 95%; }
}