:root {
  /* 颜色变量 */
  --primary-color: #4CAF50;
  --primary-hover: #45a049;
  --secondary-color: #4c6baf;
  --secondary-hover: #4d1eab;
  --danger-color: #FF5722;
  --danger-hover: #E64A19;
  --warning-color: #FF9800;
  --info-color: #2196F3;
  --info-hover: #1976D2;
  
  /* 基础阴影 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 基础布局 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 16px 0;
    text-align: center;
    overflow: hidden;
}

/* 退出按钮容器样式 */
.logout-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

#logoutButton {
    padding: 8px 16px;
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#logoutButton:hover {
    background-color: #ff3333;
}

/* 上传区域 */
.upload-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 120px 0 30px;  /* 增加上边距，避免与退出按钮重叠 */
    /* background-color: red; */
    height: 100px;
}

@media screen and (max-width: 768px) {
    .upload-container {
        margin: 120px 0 20px;  /* 移动端稍微减小边距 */
        gap: 20px;
    }
}

@media screen and (max-width: 480px) {
    .upload-container {
        margin: 100px 0 15px;  /* 更小屏幕进一步优化边距 */
        gap: 12px;
    }
}

/* 统一按钮样式 */
.upload-btn,
.query-report {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 180px;  /* 增加最小宽度 */
    height: 56px;      /* 增加高度 */
    padding: 12px 32px;  /* 增加内边距 */
    font-size: 18px;     /* 字体大小 */
    font-weight: 500;    /* 字体粗细 */
    color: #fff;
    background-color: #409eff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 鼠标悬停效果 */
.upload-btn:hover,
.query-report:hover {
    background-color: #66b1ff;  /* 更亮的蓝色 */
    transform: translateY(-2px);  /* 轻微上浮效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);  /* 增强阴影 */
}

/* 鼠标点击效果 */
.upload-btn:active,
.query-report:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .upload-container {
        gap: 20px;  /* 减小按钮间距 */
        margin: 20px 0;  /* 减小上下边距 */
    }

    .upload-btn,
    .query-report {
        min-width: 120px;  /* 减小最小宽度 */
        height: 44px;      /* 减小高度 */
        font-size: 15px;   /* 减小字体大小 */
        padding: 8px 16px; /* 减小内边距 */
    }
}

/* 更小屏幕的响应式设计 */
@media screen and (max-width: 480px) {
    .upload-container {
        gap: 12px;  /* 进一步减小间距 */
    }

    .upload-btn,
    .query-report {
        min-width: 100px;  /* 进一步减小最小宽度 */
        font-size: 14px;   /* 进一步减小字体 */
        padding: 8px 12px; /* 减小内边距 */
    }
}

.report-container {
    display: none;
    height: 80vh; /* 默认高度 */
    position: relative;
    padding-top: 60px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
    font-family: monospace;
    white-space: pre-wrap;
    line-height: 1.5;
    color: #333;
    transition: height 0.3s ease; /* 添加过渡效果 */
}

/* 添加特定异常指标查询时的样式 */
.report-container.specific-abnormal {
    height: 30vh;
    padding-top: 40px; /* 减小顶部内边距 */
}

.report-container select {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    z-index: 10;
    background-color: white;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.report-container #queryTypeSelect {
    top: 10px;
    border-color: var(--primary-color);
}

.report-container #reportTimeSelect,
.report-container #itemSelect,
.report-container #abnormalItemSelect {
    top: 70px;
    border-color: var(--secondary-color);
}

#reportContent {
    height: calc(100% - 60px);
    overflow-y: auto;
    padding: 10px;
    margin-top: 70px;
}

/* 预览区域 */
.preview-container {
    background-color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
    position: fixed;
    top: 16px;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 图片容器 */
.image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0 auto;
    max-width: 100%;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

/* 操作按钮 */
.action-buttons {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
    width: 100%;
}

.action-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: var(--info-hover);
    transform: translateY(-1px);
}

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

/* 按钮变体 */
.action-btn.solve { background-color: #9C27B0; }
.action-btn.identify { background-color: var(--warning-color); }
.action-btn.translate { background-color: var(--primary-color); }
.action-btn.describe { background-color: #E91E63; }
.action-btn.custom { background-color: var(--info-color); }
.action-btn.read { background-color: var(--danger-color); }
.action-btn.read:hover { background-color: var(--danger-hover); }

#imagePreview {
    max-width: 100%;
    height: auto;
    display: none;
    border-radius: 8px;
    object-fit: contain;
    cursor: pointer;
}

#fileInput {
    display: none;
}

.loading {
    display: none;
    margin: 20px auto;
    font-size: 14px;
    color: #666;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .upload-btn,
    .query-report {
        width: 40%;
        /* max-width: 280px; */
        padding: 14px 20px;
    }
    .preview-container {
        padding: 12px;
        margin-top: 12px;
    }
    .action-buttons { gap: 8px; }
}

.markdown-body {
    color: #24292e;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin: 24px 0 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-body h1 { font-size: 2em; }
.markdown-body h2 { font-size: 1.5em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }

.markdown-body p { margin-bottom: 16px; }

.markdown-body code {
    padding: 0.2em 0.4em;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 3px;
    margin-bottom: 16px;
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

/* 修改自定义输入框样式 */
.custom-prompt {
    display: none;
    /* 改回 none，默认隐藏 */
    width: 100%;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 16px;
}

.custom-prompt textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 8px;
    background-color: white;
}

.custom-prompt button {
    width: 100%;
    padding: 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.custom-prompt button:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

.custom-prompt.show {
    display: block;
}

.parse-report {
    background-color: #FF9800;
    /* 设置为醒目的橙色 */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.parse-report:hover {
    background-color: #E68900;
    /* 悬停时变为深橙色 */
}

.parsed-report {
    display: none;
    max-height: 300px;
    /* 设置最大高度 */
    overflow-y: auto;
    /* 启用垂直滚动 */
    padding: 12px;
    background-color: #f8f9fa;
    /* 背景颜色 */
    border-radius: 8px;
    /* 圆角 */
    border: 1px solid #dee2e6;
    /* 边框 */
    text-align: left;
    /* 左对齐 */
    margin-top: 16px;
    /* 上边距 */
    font-family: monospace;
    /* 使用等宽字体 */
    white-space: pre-wrap;
    /* 保留空格和换行 */
    line-height: 1.5;
    /* 行高 */
    color: #333;
    /* 字体颜色 */
}

.login-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    /* 确保登录框在加载动画下方 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 0;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
}

.button-container {
    display: flex;
    justify-content: space-between;
    /* 按钮之间的间距 */
    margin-top: 10px;
    /* 上边距 */
}

.modal-content button {
    flex: 1;
    /* 按钮占据相同的宽度 */
    margin: 0 5px;
    /* 按钮之间的间距 */
    background-color: #4CAF50;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.modal-content button:hover {
    background-color: #45a049;
}

.auth-btn {
    position: absolute;
    /* 绝对定位 */
    top: 16px;
    /* 距离顶部16px */
    right: 16px;
    /* 距离右侧16px */
    background: none;
    /* 去掉背景 */
    border: none;
    /* 去掉边框 */
    color: #2196F3;
    /* 设置文本颜色 */
    font-size: 16px;
    /* 设置字体大小 */
    cursor: pointer;
    /* 鼠标悬停时显示为手型 */
    text-decoration: underline;
    /* 添加下划线 */
}

.auth-btn:hover {
    color: #1976D2;
    /* 悬停时颜色变化 */
}

.action-btn.upload-report {
    background-color: #3700ff;
    /* 设置为醒目的橙色 */
    color: white;
    /* 字体颜色为白色 */
    border: none;
    /* 去掉边框 */
    border-radius: 8px;
    /* 圆角 */
    cursor: pointer;
    /* 鼠标悬停时显示为手型 */
    padding: 12px;
    /* 内边距 */
    font-size: 16px;
    /* 字体大小 */
    transition: background-color 0.3s ease;
    /* 背景颜色过渡效果 */
}

.action-btn.upload-report:hover {
    background-color: #4900e6;
    /* 悬停时变为深橙色 */
}



.action-btn.add-report {
    background-color: #FF5722;
    /* 设置为醒目的橙色 */
    color: white;
    /* 字体颜色为白色 */
    border: none;
    /* 去掉边框 */
    border-radius: 8px;
    /* 圆角 */
    cursor: pointer;
    /* 鼠标悬停时显示为手型 */
    padding: 12px;
    /* 内边距 */
    font-size: 16px;
    /* 字体大小 */
    transition: background-color 0.3s ease;
    /* 背景颜色过渡效果 */
}

.action-btn.add-report:hover {
    background-color: #E64A19;
    /* 悬停时变为深橙色 */
}

/* 美化下拉列表 */
#queryTypeSelect,
#reportTimeSelect,
#itemSelect,
#abnormalItemSelect {
    width: 90%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    margin-top: 10px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#queryTypeSelect:hover,
#reportTimeSelect:hover,
#itemSelect:hover,
#abnormalItemSelect:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#queryTypeSelect:focus,
#reportTimeSelect:focus,
#itemSelect:focus,
#abnormalItemSelect:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* 美化选项样式 */
#queryTypeSelect option,
#reportTimeSelect option,
#itemSelect option,
#abnormalItemSelect option {
    padding: 12px;
    font-size: 15px;
    background-color: white;
    color: #333;
}

/* 添加按钮容器样式 */
.button-group {
    position: sticky;
    bottom: 0;
    background-color: white;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 修改图表容器样式 */
#chartContainer {
    width: 100% !important;
    height: calc(100% - 100px) !important; /* 减小与select的距离 */
    margin-top: 20px; /* 减小顶部边距 */
    margin-bottom: 20px;
    padding: 0;
    box-sizing: border-box;
}

