/* 全局变量定义 */
:root {
    --primary-color: #165DFF;
    --primary-dark: #0E42CC;
    --primary-light: #3F83FF;
    --secondary-color: #1d4ed8;
    --success-color: #15803d;
    --danger-color: #b91c1c;
    --warning-color: #d97706;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-light: #9ca3af;
    --bg-light: #f9fafb;
    --bg-dark: #1f2937;
    --border-color: #e5e7eb;
}

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

/* 轮播图样式 */
.carousel-inner {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.carousel-item {
    width: 100%;
    flex-shrink: 0;
}

/* 轮播图文字样式优化 */
.carousel-item h1 {
    font-size: 3rem !important;
    color: #FFFFFF !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    font-weight: 700 !important;
}

@media (min-width: 768px) {
    .carousel-item h1 {
        font-size: 4rem !important;
    }
}

@media (min-width: 1024px) {
    .carousel-item h1 {
        font-size: 5rem !important;
    }
}

.carousel-item p {
    font-size: 1.5rem !important;
    color: #FFFFFF !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    line-height: 1.6 !important;
}

@media (min-width: 768px) {
    .carousel-item p {
        font-size: 1.75rem !important;
    }
}

/* 轮播图按钮样式优化 */
.carousel-item a {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

/* 轮播控制按钮样式 */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-dark);
    font-size: 18px;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel-control:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* 轮播指示器样式 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.carousel-indicators button.opacity-100 {
    background-color: white;
}

.carousel-indicators button.opacity-50 {
    opacity: 0.5;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

/* 统一的hero-section样式 - 确保所有蓝底白字区域都像首页一样清晰可见 */
.hero-section, 
.bg-gradient-to-r.from-blue-700, 
.bg-primary, 
.bg-dark {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 特别优化页面标题区域的文本可读性 */
.hero-section h1, 
.hero-section h2, 
.hero-section p,
.bg-gradient-to-r.from-blue-700 h1, 
.bg-gradient-to-r.from-blue-700 h2, 
.bg-gradient-to-r.from-blue-700 p {
    color: white !important;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5) !important;
    font-weight: 600 !important;
    font-size: inherit;
}

/* 确保标题文字清晰突出 */
.hero-section h1, .bg-gradient-to-r.from-blue-700 h1 {
    font-size: 2.5rem !important;
    line-height: 1.2;
}

@media (min-width: 768px) {
  .hero-section h1, .bg-gradient-to-r.from-blue-700 h1 {
    font-size: 3.5rem !important;
  }
}

@media (min-width: 1024px) {
  .hero-section h1, .bg-gradient-to-r.from-blue-700 h1 {
    font-size: 4.5rem !important;
  }
}

/* 深色背景上的链接颜色特殊处理 */
.bg-gradient-to-r.from-blue-700 a:not(.btn), .bg-primary a:not(.btn), .bg-dark a:not(.btn) {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* 深色背景上的按钮保持原有样式 */
.bg-gradient-to-r.from-blue-700 .btn, .bg-primary .btn, .bg-dark .btn {
    color: var(--text-primary) !important;
}

/* 轮播图中白色背景按钮的文本颜色 - 更精确的选择器 */
.carousel-item .bg-white, 
.carousel-item .bg-white span, 
.carousel-item .bg-white a, 
.carousel-item .bg-white * {
    color: var(--primary-dark) !important;
}

/* 导航栏样式 - 简化版本，避免与页面特定样式冲突 */
/* 注释掉全局固定样式，允许各页面自定义导航栏 */
/*
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

#navbar * {
    box-sizing: border-box !important;
}

#navbar .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#navbar {
    position: relative;
    z-index: 1000;
}

#navbar .container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

#navbar .menu-scroll-container {
    display: flex !important;
    align-items: center !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    padding: 0 1rem !important;
    flex: 1 !important;
    height: 100% !important;
}

#navbar .hidden.md\:flex {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
    width: auto !important;
    min-width: auto !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    padding: 0.5rem 0 !important;
}

#navbar .hidden.md\:flex a {
    padding: 0.75rem 0 !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

#navbar .menu-scroll-container::-webkit-scrollbar {
    display: none !important;
}

#navbar .menu-scroll-container {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

@media (max-width: 1200px) {
    #navbar .menu-scroll-container {
        max-width: calc(100vw - 180px) !important;
        overflow-x: auto !important;
    }
}

@media (max-width: 768px) {
    #navbar .menu-scroll-container {
        display: none !important;
    }
}

#navbar #mobile-menu {
    background-color: white !important;
    border-top: none !important;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 80px 20px 20px;
    box-sizing: border-box;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

#navbar #mobile-menu a {
    display: block;
    padding: 18px 0;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

#navbar #mobile-menu .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

#navbar.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

#navbar.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

#navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
*/

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* 段落样式 */
p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 表单样式 */
.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 网格系统 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

/* 响应式断点 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .card-img-top {
        height: 180px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .card-img-top {
        height: 150px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* 阴影样式 */
.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* 背景样式 */
.bg-primary {
    background-color: var(--primary-color);
}

.bg-secondary {
    background-color: #f8f9fa;
}

.bg-dark {
    background-color: #2c3e50;
}

.bg-light {
    background-color: #f8f9fa;
}

/* 文本颜色 */
.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-dark {
    color: #2c3e50;
}

.text-light {
    color: #f8f9fa;
}

/* 文本对齐 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 间距工具 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(22, 93, 255, 0.4);
}

/* 案例筛选按钮 */
.case-filter {
    transition: all 0.3s ease;
}

.case-filter:hover {
    transform: translateY(-2px);
}

.case-filter.active {
    background-color: var(--primary-color);
    color: white;
}

/* 轮播图样式 */
.slider {
    position: relative;
    overflow: hidden;
}

/* 医疗系统页面样式 */

/* 表单元素样式 */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #165DFF;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

/* 文件上传区域样式 */
#tongue-photo-upload-area,
#medical-report-upload-area {
    transition: all 0.3s ease;
}

#tongue-photo-upload-area:hover,
#medical-report-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #fdf2f2;
}

/* 结果显示区域样式 */
#result-container {
    min-height: 300px;
    max-height: 600px;
}

#diagnosis-result {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* 加载动画样式 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 记录列表样式 */
#records-list {
    border-top: 1px solid #eee;
}

.record-item {
    transition: background-color 0.3s ease;
}

.record-item:hover {
    background-color: #f8f9fa;
}

/* 不适描述样式 */
#symptom-1,
[id^="symptom-"] {
    transition: all 0.3s ease;
}

[id^="symptom-"]:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 按钮样式增强 */
.btn {
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* 响应式表单布局 */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    #medical-form .grid {
        grid-template-columns: 1fr;
    }
    
    #medical-form .md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    #medical-form .md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* 医疗系统页面的卡片样式 */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 医疗系统页面的标题样式 */
#medical-system h1,
#medical-system h2,
#medical-system h3,
#medical-system h4 {
    color: var(--text-primary);
}

/* 文件预览样式 */
#tongue-photo-img {
    max-height: 300px;
    object-fit: contain;
}

/* 标签和输入框对齐 */
input[type="number"],
input[type="text"],
select,
textarea {
    font-family: inherit;
}

/* 进度指示器 */
.progress-container {
    position: relative;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
    position: relative;
}

/* FAQ 样式 */
.faq-toggle {
    cursor: pointer;
}

.faq-toggle.active i {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-content.active {
    max-height: 500px;
}

/* 团队成员卡片 */
.team-card {
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
}

/* 服务卡片 */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

/* 响应式导航栏 - 兼容全屏模态菜单样式 */
@media (max-width: 768px) {
    /* 确保全屏模态菜单不受影响 */
    #mobile-menu.fixed {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        background-color: rgba(17, 24, 39, 0.9) !important;
        z-index: 50 !important;
    }
    
    /* 保留原有下拉菜单样式以兼容其他页面 */
    #mobile-menu:not(.fixed) {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    #mobile-menu:not(.fixed).open {
        max-height: 500px; /* 增加高度以容纳所有7个菜单项 */
    }
}

/* 加载动画 */
.loader {
    border: 3px solid rgba(22, 93, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* 表单验证状态 */
.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* 统计数字动画 */
.counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0;
    transform: translateY(20px);
}

.counter.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

/* 自定义滚动条 */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

/* 媒体查询优化 */
@media (max-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}