body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    /* 渐变背景 */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    background: linear-gradient(45deg, #f3ec78, #af4261), 
                linear-gradient(135deg, #84fab0, #8fd3f4);
    background-blend-mode: overlay;
    animation: GradientAnimation 15s ease infinite;
}

@keyframes GradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: stretch; /* 使子容器高度一致 */
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    gap: 40px; /* 添加间距，确保容器之间有足够的空间 */
}

.container, #videoContainer {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px; /* 统一 padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 45%; /* 保持与原始 `.container` 相同的宽度 */
    text-align: center;
    transition: all 0.3s ease;
}

.container {
    margin-right: 0; /* 移除右边距，使用 `gap` 来控制间距 */
}

#videoContainer {
    display: none;
    flex-shrink: 0;
}

h1 {
    color: #1d1d1f;
    font-weight: 500;
    font-size: 26px;
    margin-bottom: 20px;
}

#welcomePage, #questionContainer, #chatInterface {
    display: none;
}

#welcomePage {
    animation: fadeIn 1s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, box-shadow 0.3s;
    margin-top: 20px;
    font-weight: 500;
}

.btn:hover {
    background-color: #0051a8;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.option {
    display: block;
    width: 100%;
    padding: 12px 0;
    margin-bottom: 12px;
    background-color: #f2f2f7;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    font-size: 16px;
    font-weight: 400;
}

.option:hover {
    background-color: #e5e5ea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#chatbox {
    height: 300px;
    border: 1px solid #d1d1d6;
    padding: 20px;
    overflow-y: auto;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 和 Edge */
}

#chatbox::-webkit-scrollbar {
    display: none; /* Safari 和 Chrome */
}

.chat-input-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#messageInput {
    flex-grow: 1;
    padding: 12px 16px;
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    font-size: 16px;
    margin-right: 10px;
    background-color: #f2f2f7;
    transition: border-color 0.3s;
}

#messageInput:focus {
    border-color: #007aff;
    outline: none;
}

#sendMessage {
    padding: 12px 24px;
    background-color: #34c759;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    white-space: nowrap;
    font-weight: 500;
}

#sendMessage:hover {
    background-color: #28a745;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.message {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 16px;
}

.user-message {
    background-color: #e1f5fe;
    text-align: right;
}

.ai-message {
    background-color: #f1f1f1;
}

.message-sender {
    font-weight: 600;
    margin-right: 6px;
}

/* Markdown 内容的基本样式 */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    font-weight: bold;
    margin: 10px 0;
}

.message-content p {
    margin: 10px 0;
    line-height: 1.5;
    text-align: left;
}

.message-content a {
    color: #007aff;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content ul,
.message-content ol {
    margin: 10px 0 10px 20px;
}

.message-content blockquote {
    border-left: 4px solid #d1d1d6;
    padding-left: 10px;
    color: #555;
    margin: 10px 0;
}

.message-content code {
    background-color: #f2f2f7;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.message-content pre {
    background-color: #f2f2f7;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}


#videoOutput {
    width: 100%; /* 使其填满父容器 */
    height: 0;
    padding-bottom: 75%; /* 维持 4:3 的宽高比 (600/800 = 0.75) */
    background-color: #000;
    margin-bottom: 20px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#videoOutput img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保图像覆盖容器且保持比例 */
}

#keypointCoordinatesContainer {
    margin-top: 20px;
    text-align: left;
    color: #333;
}

#keypointCoordinatesContainer p {
    font-size: 16px;
    margin: 5px 0;
}

/* 进度指示器样式 */
.progress-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px; /* 与内容之间的间距 */
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background-color: #d1d1d6;
    z-index: -1;
}

.step.active:not(:last-child)::after {
    background-color: #007aff;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #d1d1d6;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    font-weight: bold;
}

.step.active .step-number {
    background-color: #007aff;
}

.step-label {
    font-size: 14px;
    text-align: center;
    color: #555;
}

.step.active .step-label {
    color: #007aff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .progress-indicator {
        flex-direction: column;
        align-items: flex-start;
    }

    .step {
        flex-direction: row;
        align-items: center;
        margin-bottom: 15px;
    }

    .step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 30px;
        width: 2px;
        height: 100%;
        background-color: #d1d1d6;
    }

    .step.active:not(:last-child)::after {
        background-color: #007aff;
    }

    .step-label {
        margin-left: 10px;
        text-align: left;
    }
}

@media (max-width: 1024px) {
    #videoContainer {
        width: 45%; /* 保持与 `.container` 相同 */
        height: auto;
    }

    #videoOutput {
        padding-bottom: 75%; /* 维持宽高比 */
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }

    .container, #videoContainer {
        width: 100%;
        margin-bottom: 20px;
    }

    .container {
        margin-right: 0;
    }

    .chat-input-container {
        flex-direction: column;
    }

    #messageInput {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    #sendMessage {
        width: 100%;
    }

    #videoOutput {
        padding-bottom: 75%; /* 维持宽高比 */
    }
}
