:root {
    --primary-color: #00ff9d;
    --secondary-color: #0066ff;
    --background-color: #0a0a0a;
    --text-color: #ffffff;
    --sidebar-width: 300px;
    --history-width: 300px;
    --border-radius: 10px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(0, 0, 0, 0.8);
    border-right: 1px solid var(--primary-color);
    transition: transform var(--transition-speed);
    z-index: 100;
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--primary-color);
}

.logo {
    width: 40px;
    height: 40px;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.2em;
}

.assistants-list {
    padding: 20px;
    overflow-y: auto;
    height: calc(100vh - 140px);
}

.assistant-item {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.assistant-item:hover {
    background: rgba(0, 255, 157, 0.2);
    transform: translateX(5px);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--primary-color);
}

/* Chat Container Styles */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: margin-left var(--transition-speed);
    margin-left: var(--sidebar-width);
}

.chat-container.expanded {
    margin-left: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 10px;
}

.message-content {
    flex: 1;
    background: rgba(0, 255, 157, 0.1);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-color);
    position: relative;
    max-width: 80%;
}

.message.user .message-content {
    background: rgba(0, 102, 255, 0.1);
    border-color: var(--secondary-color);
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--primary-color);
    font-size: 1.1em;
}

.message-content:hover .copy-btn {
    opacity: 1;
    transform: scale(1.1);
}

.copy-btn:hover {
    background: var(--primary-color);
    color: var(--background-color);
    transform: scale(1.2);
}

.chat-input {
    display: flex;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 15px;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    resize: none;
    height: 60px;
}

/* History Sidebar Styles */
.history-sidebar {
    width: var(--history-width);
    background: rgba(0, 0, 0, 0.8);
    border-left: 1px solid var(--primary-color);
    transform: translateX(100%);
    transition: transform var(--transition-speed);
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
}

.history-sidebar.active {
    transform: translateX(0);
}

.history-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--primary-color);
}

.history-list {
    padding: 20px;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

.history-item {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.history-item:hover {
    background: rgba(0, 255, 157, 0.2);
    transform: translateX(5px);
}

.history-toggle {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: var(--background-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
    transition: all var(--transition-speed);
    z-index: 100;
}

.history-toggle:hover {
    transform: scale(1.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-color);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-color);
    width: 90%;
    max-width: 500px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Button Styles */
.btn-primary {
    background: var(--primary-color);
    color: var(--background-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary:hover {
    background: #00cc7d;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-secondary:hover {
    background: rgba(0, 255, 157, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .chat-container {
        padding: 10px;
        margin-left: 0;
    }

    .sidebar {
        width: 100%;
        max-width: 300px;
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar:not(.collapsed) + .sidebar-overlay {
        display: block;
    }

    .chat-messages {
        padding: 10px;
    }

    .message {
        margin-bottom: 15px;
    }

    .message-content {
        max-width: 85%;
        padding: 12px;
    }

    .message-avatar {
        width: 35px;
        height: 35px;
    }

    .chat-input {
        padding: 10px;
        gap: 8px;
    }

    #userInput {
        padding: 12px;
        height: 50px;
        font-size: 16px;
    }

    .send-btn {
        padding: 12px 20px;
        min-width: 60px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-icon {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
    }

    .history-sidebar {
        width: 100%;
        max-width: 300px;
    }

    .history-toggle {
        right: 15px;
        bottom: 80px;
        width: 44px;
        height: 44px;
    }

    .modal-content {
        width: 90%;
        max-width: 400px;
        padding: 20px;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }

    ::-webkit-scrollbar {
        width: 6px;
    }

    .copy-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
        opacity: 0.8;
    }

    .assistant-item {
        padding: 12px;
        margin-bottom: 8px;
    }

    .history-item {
        padding: 12px;
        margin-bottom: 8px;
    }

    .assistant-item:active,
    .history-item:active,
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }

    .message-content {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    @media (max-height: 500px) {
        .chat-messages {
            max-height: 60vh;
        }
    }

    .expand-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .message-content {
        max-width: 90%;
    }

    .chat-input {
        flex-direction: column;
    }

    #userInput {
        width: 100%;
        margin-bottom: 8px;
    }

    .send-btn {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    html {
        font-size: 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }

    .chat-container {
        margin-left: 280px;
    }

    .message-content {
        max-width: 75%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc7d;
}

.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.assistant-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.1em;
    padding: 5px;
    transition: all var(--transition-speed);
}

.btn-icon:hover {
    color: #00cc7d;
    transform: scale(1.1);
}

.assistant-description {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-message {
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.9);
}

.history-item {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.history-item:hover {
    background: rgba(0, 255, 157, 0.2);
    transform: translateX(5px);
}

.history-item .btn-secondary {
    margin-top: 10px;
    width: 100%;
}

/* 添加一个覆盖层，在移动设备上点击时关闭侧边栏 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* 添加打字机效果 */
.typing {
    display: inline;
    position: relative;
}

.typing::after {
    content: '|';
    position: absolute;
    right: 0;
    color: var(--primary-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 展开按钮样式 */
.expand-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--background-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
    transition: all var(--transition-speed);
    z-index: 99;
}

.expand-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* 加载动画样式 */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(1) {
    animation-delay: 0s;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1);
    }
}

/* 基础字体设置 */
html {
    font-size: 14px;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 触控优化 */
.btn, .assistant-item, .history-item {
    min-height: 44px;
    min-width: 44px;
    padding: 12px;
}

/* 表单输入优化 */
input[type="text"], input[type="email"], input[type="tel"] {
    font-size: 16px;
}

/* 性能优化 */
* {
    will-change: transform;
    backface-visibility: hidden;
}

/* 图片懒加载 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

.subjects-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.subject-checkbox {
    display: none;
}

.subject-label {
    padding: 8px 15px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.subject-checkbox:checked + .subject-label {
    background: var(--primary-color);
    color: var(--background-color);
}

.subject-label:hover {
    background: rgba(0, 255, 157, 0.2);
}

.assistant-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.subject-tag {
    padding: 4px 8px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 0.9em;
    color: var(--primary-color);
}

.question-types-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.question-type-checkbox {
    display: none;
}

.question-type-label {
    padding: 8px 15px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.question-type-checkbox:checked + .question-type-label {
    background: var(--primary-color);
    color: var(--background-color);
}

.question-type-label:hover {
    background: rgba(0, 255, 157, 0.2);
}

.assistant-question-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.question-type-tag {
    padding: 4px 8px;
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 0.9em;
    color: var(--primary-color);
} 