/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.6;
    overflow: hidden;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    height: 100vh;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 顶部标题栏 */
.header {
    background-color: #07c160;
    color: white;
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
    position: relative;
    display: flex;
    justify-content: left;
    align-items: center;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* 自动播放开关样式 */
.auto-play-switch {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(255, 255, 255, 0.8);
}

input:focus + .slider {
    box-shadow: 0 0 1px rgba(255, 255, 255, 0.8);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.switch-label {
    white-space: nowrap;
    user-select: none;
}

/* 聊天内容区域 */
.chat-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px; /* 增加底部内边距，确保内容不被底部选项栏遮挡padding: 20px 20px 250px */
    background-color: #f5f5f5;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f5f5f5"/><path d="M 0 0 L 100 100" stroke="%23e8e8e8" stroke-width="0.5" opacity="0.3"/><path d="M 100 0 L 0 100" stroke="%23e8e8e8" stroke-width="0.5" opacity="0.3"/></svg>');
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 消息样式 */
.message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

.received {
    justify-content: flex-start;
}

.sent {
    justify-content: flex-end;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.received .message-content {
    background-color: #fff;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding-right: 40px; /* 增加右侧内边距，避免文字与音频按钮重叠 */
}

.sent .message-content {
    background-color: #07c160;
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 消息时间 */
.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.received .message-time {
    text-align: left;
}

/* 开始按钮 */
.start-btn {
    background-color: #07c160;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.start-btn:hover {
    background-color: #06b357;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* 音频控制按钮 */
.audio-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s ease;
}

.audio-btn:hover {
    color: #07c160;
}

/* 底部选项区域 */
.chat-footer {
    background-color: #fff;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

/* 作答引导提示 */
.answer-guide {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 500;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background-color: #e8f4fd;
    border-color: #07c160;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.option-btn:active {
    transform: translateY(0);
}

/* 查看报告按钮 */
.view-report-btn {
    background-color: #07c160;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-report-btn:hover {
    background-color: #06b357;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

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

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

@keyframes sendBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sent .message-content {
    animation: sendBounce 0.3s ease;
}

.received .message-content {
    animation: slideIn 0.3s ease;
}

/* 滚动条样式 */
.chat-main::-webkit-scrollbar {
    width: 6px;
}

.chat-main::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-main::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-main::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .message-content {
        max-width: 85%;
    }
    
    .chat-main {
        padding: 15px 10px;
    }
    
    .chat-footer {
        padding: 10px;
    }
    
    .option-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background-color: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.loading-dot {
    width: 6px;
    height: 6px;
    background-color: #07c160;
    border-radius: 50%;
    animation: loadingPulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingPulse {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}