/* 基础样式重置 - Material Design风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a237e; /* 深蓝主色调 */
    --primary-light: #534bae;
    --primary-dark: #000051;
    --secondary-color: #ffffff; /* 白色 */
    --background-color: #f5f5f5; /* 浅灰背景 */
    --text-color: #212121;
    --text-secondary: #757575;
    --divider-color: #e0e0e0;
    --error-color: #d32f2f;
    --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 8px 16px rgba(0, 0, 0, 0.14);
    --border-radius: 4px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器样式 */
.container {
    max-width: 100%;
    padding: 12px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 16px;
    padding: 16px 0 8px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
}

header h1 {
    color: var(--secondary-color);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}



/* 主要内容区域 */
main {
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    flex: 1;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}
.banner-container {
  width: 100%; /* 或你想要的容器宽度 */
  height: auto; /* 高度自适应 */
}

.banner-container img {
  width: 100%;
  height: auto; /* 关键：保持原始比例 */
  display: block; /* 避免底部空白间隙 */
}
/* 表单部分 */
.client-form {
    padding: 16px;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 16px;
}

.client-form h2 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.3rem;
    font-weight: 500;
    border-bottom: 1px solid var(--divider-color);
    padding-top: 8px;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
}

.client-form h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    margin-right: 8px;
    border-radius: 2px;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 8px 0;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--divider-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: all var(--transition-speed);
    background-color: rgba(0, 0, 0, 0.02);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 35, 126, 0.2);
    background-color: var(--secondary-color);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
                      linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

/* 添加Material Design风格的输入框下划线效果 */
.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.form-group:focus-within::after {
    width: 100%;
    left: 0;
}

textarea {
    resize: vertical;
}

.form-actions {
    margin-top: 24px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.btn-primary:active {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-light);
    transform: translateY(1px);
}

.btn-primary:disabled,
.btn-primary.btn-disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-primary:disabled:hover,
.btn-primary.btn-disabled:hover {
    background-color: #ccc;
    box-shadow: none;
    transform: none;
}

/* 诊断结果部分 */
.diagnosis-result {
    padding: 16px;
    border-top: 1px solid var(--divider-color);
    display: none; /* 初始隐藏 */
    animation: fadeIn 0.5s ease-in-out;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-top: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.diagnosis-result.active {
    display: block;
}

.diagnosis-result h2 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.3rem;
    font-weight: 500;
    border-bottom: 1px solid var(--divider-color);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
}

.diagnosis-result h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    margin-right: 8px;
    border-radius: 2px;
}

.loading {
    text-align: center;
    padding: 24px 0;
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(26, 35, 126, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-content {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 8px;
    box-shadow: var(--shadow-light);
}

/* Markdown 样式 */
.result-content h1, 
.result-content h2, 
.result-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 500;
}

.result-content h1 {
    font-size: 1.4rem;
    border-bottom: 1px solid var(--divider-color);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.result-content h2 {
    font-size: 1.2rem;
    margin-top: 24px;
}

.result-content h3 {
    font-size: 1.1rem;
    color: var(--primary-light);
}

.result-content p {
    margin-bottom: 15px;
}

.result-content ul, 
.result-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.result-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    color: var(--text-secondary);
    margin: 16px 0;
    background-color: rgba(26, 35, 126, 0.05);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 16px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        padding: 16px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .client-form h2,
    .diagnosis-result h2 {
        font-size: 1.4rem;
    }
    
    /* 添加卡片式布局 */
    main {
        border-radius: 8px;
        box-shadow: var(--shadow-medium);
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .search-bar {
        max-width: 70%;
        padding: 8px 16px;
    }
    
    .nav-item {
        font-size: 0.8rem;
    }
    
    .nav-item .material-icons {
        font-size: 24px;
        margin-bottom: 4px;
    }
}

/* 添加错误样式 */
.error {
    border-color: var(--error-color) !important;
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: '⚠';
    margin-right: 4px;
    font-size: 0.9rem;
}