/* 字体加载优化 */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Inter Regular'), local('Inter-Regular'), 
         url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local('Inter Medium'), local('Inter-Medium'),
         url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fAZ9hiA.woff2) format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: local('Inter SemiBold'), local('Inter-SemiBold'),
         url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2) format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local('Inter Bold'), local('Inter-Bold'),
         url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYAZ9hiA.woff2) format('woff2');
}

:root {
    --primary-color: #2563eb; /* 更深的蓝色，更专业 */
    --primary-light: #eff6ff;
    --text-primary: #1e293b; /* 更深的文本颜色，提高可读性 */
    --text-secondary: #64748b;
    --background-color: #ffffff;
    --nav-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --section-background: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition-smooth: all 0.3s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif; /* 添加Inter字体 */
    line-height: 1.7;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    background-color: var(--section-background);
    letter-spacing: 0.015em; /* 轻微增加字母间距 */
}

/* 页面容器增加最大宽度限制 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 标题区域样式改进 */
header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); /* 渐变背景 */
    padding: 1.5rem 0;
    text-align: center;
    border-bottom: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    background-color: var(--section-background);
    border-top: 1px solid var(--border-color);
}

header h1 {
    color: white;
    margin: 0 0 1.2rem 0;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

nav li {
    margin: 0.25rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    transition: var(--transition-smooth);
    display: block;
    font-weight: 500;
    opacity: 0.9;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
    transform: translateY(-2px);
}

nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
    opacity: 1;
}

main {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 2.5rem;
    background: var(--background-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

/* 标题样式 */
h1, h2, h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

h1 { 
    font-size: 2.2rem; 
    margin-top: 0.5rem;
}

h2 { 
    font-size: 1.7rem; 
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.7rem;
    margin-top: 2.5rem;
}

h3 { 
    font-size: 1.35rem; 
    color: #334155; /* 稍微淡一点的标题颜色 */
}

/* 段落和列表样式 */
p {
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

ul, ol {
    padding-left: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* 强调内容 */
b, strong {
    color: #1e40af; /* 深蓝色 */
    font-weight: 600;
}

/* 代码块样式 */
pre {
    background: #f8fafc;
    padding: 1.2rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #334155;
    margin: 1.8rem 0;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

/* 引用样式 */
blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background-color: var(--primary-light);
    border-radius: 0 8px 8px 0;
    color: #334155;
    font-style: italic;
}

/* 聊天界面样式 - 非页面容器版本 */
.chat-container-simple {
    max-width: 600px;
    margin: 0 auto;
    background: var(--background-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background-color: #fafbfc; /* 轻微的背景色差异 */
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.message {
    margin: 12px 0;
    padding: 14px 18px;
    border-radius: 14px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
    line-height: 1.6;
    font-size: 1.05rem;
}

.user-message {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-radius: 14px 14px 0 14px;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.2);
}

.bot-message {
    background: white;
    color: var(--text-primary);
    margin-right: auto;
    border-radius: 14px 14px 14px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaecef;
}

#chat-input-area {
    display: flex;
    padding: 18px;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    background-color: white;
    border-radius: 0 0 12px 12px;
}

#chat-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    max-height: 150px;
    min-height: 50px;
    overflow-y: auto;
    transition: all 0.25s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#chat-send {
    align-self: flex-end;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    height: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-send:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.25);
}

#chat-send:active {
    transform: translateY(0);
}

/* 页脚段落样式 */
footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 错误信息与提示区域 */
.solution-options {
    background-color: #f8fafc;
    border-left: 4px solid var(--primary-color);
    padding: 1.2rem 1.5rem;
    margin: 1.8rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

/* 体验大模型页面样式 */
.chat-page-container {
    display: flex;
    gap: 25px;
    height: calc(100vh - 220px);
    min-height: 650px;
    max-width: 1300px;
    margin: 2rem auto;
    padding: 20px;
}

/* 左侧提示词示例区域 */
.prompt-examples {
    flex: 0 0 35%;
    overflow-y: auto;
    padding: 25px;
    background: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06),
                0 0 0 1px rgba(37, 99, 235, 0.05) inset;
    border: 1px solid var(--border-color);
}

.prompt-description {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.prompt-categories {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.prompt-category h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.2rem;
    color: #334155;
}

.prompt-item {
    padding: 15px 18px;
    border-radius: 8px;
    background: var(--primary-light);
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-left: 3px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.prompt-item:hover {
    background: #e3ebfd;
    border-left-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.prompt-item.active {
    background: #d1e0fc;
    border-left-color: var(--primary-color);
}

.prompt-title {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.prompt-preview {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

/* 右侧聊天界面 */
.chat-interface {
    flex: 0 0 65%;
    display: flex;
    flex-direction: column;
}

#chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--background-color);
    border-radius: 16px;
    width: 95%;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(37, 99, 235, 0.05) inset;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background-color: #fafbfc; /* 轻微的背景色差异 */
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.message {
    margin: 12px 0;
    padding: 14px 18px;
    border-radius: 14px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
    line-height: 1.6;
    font-size: 1.05rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-radius: 14px 14px 0 14px;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.2);
}

.bot-message {
    background: white;
    color: var(--text-primary);
    margin-right: auto;
    border-radius: 14px 14px 14px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaecef;
}

.bot-message ul, .bot-message ol {
    margin: 12px 0;
    padding-left: 25px;
}

.bot-message li {
    margin-bottom: 8px;
}

/* 思考中状态样式 */
.thinking {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin: 12px 0;
    background: white;
    max-width: 160px;
    margin-right: auto;
    border-radius: 14px 14px 14px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaecef;
    animation: fadeIn 0.3s ease;
    position: relative;
}

.thinking p {
    margin: 0 0 0 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin-right: 4px;
    animation: pulse 1.5s infinite ease-in-out;
    opacity: 0.7;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0% { transform: scale(0.7); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.9; }
    100% { transform: scale(0.7); opacity: 0.4; }
}

/* 加载动画 */
.loader {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-container {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* 图片和媒体增强 */
img, video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1.5rem auto;
}

figure {
    margin: 2rem 0;
    text-align: center;
}

figcaption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow-x: auto;
    display: block;
}

table, th, td {
    border: 1px solid var(--border-color);
}

th {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    text-align: left;
}

th, td {
    padding: 0.75rem 1rem;
}

tr:nth-child(even) {
    background-color: rgba(241, 245, 249, 0.5);
}

tr:hover {
    background-color: rgba(241, 245, 249, 0.8);
}

@media (prefers-color-scheme: dark) {
    tr:nth-child(even) {
        background-color: rgba(30, 41, 59, 0.5);
    }
    
    tr:hover {
        background-color: rgba(30, 41, 59, 0.8);
    }
    
    th {
        background-color: #1e3a8a;
        color: #e2e8f0;
    }
}

/* Mermaid 图表样式 */
.mermaid-wrapper {
    margin: 2rem auto;
    background-color: var(--section-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow-x: auto;
    max-width: 100%;
    transition: all 0.3s ease;
}

.mermaid-wrapper:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

body.dark-theme .mermaid-wrapper {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mermaid {
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin: 0 auto;
}
