/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 30px 15px;
}

/* 头部 */
.header {
    background-color: #2178ca;
    color: white;
    text-align: center;
    padding: 20px 0;
    position: relative;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.header-logo {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
}

.header-logo img {
    width: 100%;
    height: 100%;
    border-radius: 5px;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 2px solid #b8daff;
}

.card h2 {
    color: #2178ca;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

/* 输入框和按钮 */
.input-group {
    margin-bottom: 15px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    height: 44px;
    box-sizing: border-box;
}

.input-group textarea {
    resize: none;
    min-height: 100px;
}

/* 诊断报告专项解读输入框 */
#report-input {
    background-color: #f8faff;
}

.btn {
    background-color: #2178ca;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #1a64a5;
}

/* AI问答区域 */
.ai-chat {
    margin-bottom: 15px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
}

.chat-message.user {
    background-color: #e3f2fd;
    text-align: right;
}

.chat-message.ai {
    background-color: #f1f1f1;
    text-align: left;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 5px;
    margin-bottom: 15px;
}

.typing-indicator span {
    height: 10px;
    width: 10px;
    margin: 0 2px;
    background-color: #2178ca;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 图片上传区域 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: border-color 0.3s;
    position: relative;
}

.upload-area:hover {
    border-color: #2178ca;
}

.upload-area input {
    display: none;
}

.upload-area * {
    position: relative;
    z-index: 1;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.upload-area i {
    font-size: 30px;
    color: #2178ca;
    margin-bottom: 10px;
}

.upload-area p {
    font-size: 14px;
    color: #666;
}

.preview-image {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 5px;
}

/* 自检自查区域 */
.self-check {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.self-check-item {
    text-align: center;
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.self-check-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.self-check-item i {
    font-size: 24px;
    color: #2178ca;
    margin-bottom: 8px;
}

.self-check-item {
    text-decoration: none;
    color: inherit;
}

.self-check-item span {
    font-size: 12px;
    display: block;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-item {
    text-align: center;
    color: #666;
    text-decoration: none;
}

.bottom-nav-item i {
    font-size: 20px;
    display: block;
    margin-bottom: 5px;
}

.bottom-nav-item span {
    font-size: 12px;
}

.bottom-nav-item.active {
    color: #2178ca;
}

/* 信息区域 */
.info-section {
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
    color: #2178ca;
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
}

.info-links {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.info-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    margin: 5px;
}

/* 统计和版权 */
.footer {
    text-align: center;
    padding: 15px;
    margin-top: 15px;
    margin-bottom: 70px; /* 为底部导航留出空间 */
    font-size: 12px;
    color: #666;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2178ca;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-input-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    height: 44px;
    box-sizing: border-box;
}

.ai-buttons {
    display: flex;
    gap: 10px;
}

.ai-buttons .btn {
    width: 120px;
    margin: 0 auto;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .self-check {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .card h2 {
        font-size: 16px;
    }
    
    .ai-buttons {
        flex-direction: column;
    }
}