/* index.css - 首页专用样式 */

:root {
    --primary-green: #1b5e20;
    --dark-green: #0d4718;
    --white: rgba(255, 255, 255, 0.86);
    --black: #000000;
    --text-dark: #000000;
    --text-light: #666666;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --carousel-height: 300px; /* 添加缺失的自定义属性 */
    --carousel-height-mobile: 300px;
    --carousel-height-small: 250px;
}

.main-content-container {
    padding-top: 2rem;
    padding-bottom: 2rem;
    min-height: calc(100vh - 120px); /* 保留最小高度，但允许内容溢出 */
    /* 移除 overflow: hidden; 若存在 */
  }

/* 布局间距 */
.section-spacing {
    margin-bottom: 2rem;
}

.card-spacing {
    margin-bottom: 1.5rem;
}

/* index.css - 轮播图样式修改 */

/* 轮播图容器 - 移除固定高度，使用自适应 */
.research-carousel-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    /* 移除固定高度，使用内容自适应 */
    height: auto;
    min-height: 300px; /* 设置最小高度 */
}

/* 轮播图区域 - 使用自适应高度 */
#researchCarousel {
    border-radius: var(--border-radius);
    overflow: visible; /* 改为visible让图片可以显示到容器外 */
    height: auto; /* 自适应高度 */
}

.carousel-inner {
    height: auto; /* 自适应高度 */
    border-radius: var(--border-radius);
}

.carousel-item {
    height: auto; /* 自适应高度 */
    min-height: 300px; /* 设置最小高度 */
    transition: transform 0.6s ease-in-out;
}

/* 图片样式 - 关键修改 */
.carousel-item img {
    width: 100%;
    height: auto; /* 改为auto保持原始比例 */
    object-fit: contain; /* 改为contain确保完整显示图片 */
    object-position: center;
    background-color: #f8f9fa;
    display: block;
    border-radius: var(--border-radius);
}

/* 轮播图指示器位置调整 */
.carousel-indicators {
    bottom: -40px; /* 将指示器移到容器外部 */
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: var(--primary-green);
    opacity: 0.5;
}

.carousel-indicators button.active {
    opacity: 1;
}

/* 导航按钮位置调整 */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    transition: var(--transition);
    margin: 0 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-gray);
}

.carousel-control-prev {
    left: -25px; /* 移到容器左侧外部 */
}

.carousel-control-next {
    right: -25px; /* 移到容器右侧外部 */
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: var(--primary-green);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* 确保应用场景卡片与轮播图高度匹配 */
.research-info-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    height: auto; /* 改为自适应 */
    min-height: 300px; /* 设置最小高度 */
    display: flex;
    flex-direction: column;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .research-carousel-card,
    .research-info-card {
        height: auto;
        min-height: 250px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
        margin: 0 0.5rem;
    }

    .carousel-control-prev {
        left: -20px;
    }

    .carousel-control-next {
        right: -20px;
    }

    .carousel-indicators {
        bottom: -35px;
    }
}

@media (max-width: 576px) {
    .research-carousel-card,
    .research-info-card {
        min-height: 200px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 35px;
        height: 35px;
        margin: 0 0.25rem;
    }

    .carousel-control-prev {
        left: -15px;
    }

    .carousel-control-next {
        right: -15px;
    }

    .carousel-indicators {
        bottom: -30px;
    }
}

/* 右侧应用场景卡片 - 与左侧轮播图高度一致 */
.research-info-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    height: 460px;
    display: flex;
    flex-direction: column;
}

.research-info-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-gray);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.research-info-card .card-header h5 {
    color: var(--black);
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.card-header-icon {
    margin-right: 0.5rem;
    color: var(--primary-green);
}

.research-info-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    overflow: hidden;
}

/* 应用场景展示 */
.scenario-showcase {
    height: 100%;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scenario-item {
    position: relative;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scenario-item.active {
    opacity: 1;
}

.scenario-content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scenario-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    flex-shrink: 0;
}

.scenario-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    color: var(--white);
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 10;
}

.scenario-content h6 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.scenario-content p {
    font-size: 0.75rem;
    margin-bottom: 0;
    line-height: 1.3;
}

/* 按钮样式 */
.btn {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--dark-green);
    border-color: var(--dark-green);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-outline-primary:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    transform: translateY(-1px);
}

/* 核心功能卡片 */
.core-functions-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.function-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid transparent;
    height: 100%;
}

.function-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.function-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.function-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.function-content h5 {
    color: var(--black);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.function-content p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.function-btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--primary-green);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--primary-green);
    font-size: 0.9rem;
}

.function-btn:hover {
    background: var(--dark-green);
    border-color: var(--dark-green);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-2px);
}

/* 平台数据概览卡片 */
.platform-overview-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.platform-overview-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-gray);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
}

.platform-overview-card .card-header h5 {
    color: var(--black);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.platform-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    height: 100%;
}

.platform-stat-card {
    padding: 1rem 0.5rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-gray);
    transition: var(--transition);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-stat-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.stat-content .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-content .stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* 高频作物快速检测 */
.quick-detection-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.quick-detection-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-gray);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
}

.quick-detection-card .card-header h5 {
    color: var(--black);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.crop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.crop-card {
    padding: 1.25rem 1rem;
    background: var(--light-gray);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.crop-card:hover {
    border-color: var(--primary-green);
    background: var(--primary-green);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.crop-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.crop-card:hover .crop-icon {
    background: var(--white);
}

.crop-icon i {
    color: var(--white);
    font-size: 1.1rem;
}

.crop-card:hover .crop-icon i {
    color: var(--primary-green);
}

.crop-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: inherit;
}

/* 最近检测记录 */
.recent-detections-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.recent-detections-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-gray);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recent-detections-card .card-header h5 {
    color: var(--black);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.detection-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detection-item {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.detection-item:hover {
    background: var(--light-gray);
}

.detection-item:last-child {
    border-bottom: none;
}

.detection-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.detection-details {
    flex: 1;
}

.detection-details .crop-name {
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.detection-details .detection-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

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

.vitality-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-high {
    background: #e8f5e8;
    color: var(--primary-green);
}

.badge-medium {
    background: #fff3e0;
    color: #f57c00;
}

.badge-low {
    background: #ffebee;
    color: #d32f2f;
}

.view-all-btn {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.view-all-btn:hover {
    color: var(--dark-green);
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content-container {
        padding-top: 1.5rem;
    }

    .section-spacing {
        margin-bottom: 1.5rem;
    }

    .card-spacing {
        margin-bottom: 1rem;
    }

    .function-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .platform-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .crop-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .platform-stat-card {
        padding: 1.25rem 1rem;
    }

    .stat-content .stat-number {
        font-size: 1.4rem;
    }

    /* 移动端调整轮播图和应用场景卡片高度 */
    .research-carousel-card,
    .research-info-card {
        height: var(--carousel-height-mobile, 300px);
    }
}

@media (max-width: 576px) {
    .main-content-container {
        padding-top: 1rem;
    }

    .function-card {
        padding: 1.25rem 1rem;
    }

    .function-icon {
        width: 50px;
        height: 50px;
    }

    .function-icon i {
        font-size: 1.3rem;
    }

    /* 小屏幕进一步调整高度 */
    .research-carousel-card,
    .research-info-card {
        height: var(--carousel-height-small, 250px);
    }
}

/* 确保 Font Awesome 图标正确加载 */

/* index.css - 修改作物图标为表情符号 */

/* 水稻图标 */
.crop-card[data-crop="rice"] .crop-icon i,
.crop-card[data-crop="rice"] .crop-icon::before {
    content: "🌾";
    font-family: initial; /* 移除 Font Awesome 字体 */
    font-size: 1.3rem;
}

/* 小麦图标 */
.crop-card[data-crop="wheat"] .crop-icon i,
.crop-card[data-crop="wheat"] .crop-icon::before {
    content: "🌱";
    font-family: initial;
    font-size: 1.3rem;
}

/* 玉米图标 */
.crop-card[data-crop="corn"] .crop-icon i,
.crop-card[data-crop="corn"] .crop-icon::before {
    content: "🌽";
    font-family: initial;
    font-size: 1.3rem;
}

/* 大豆图标 */
.crop-card[data-crop="soybean"] .crop-icon i,
.crop-card[data-crop="soybean"] .crop-icon::before {
    content: "🫘";
    font-family: initial;
    font-size: 1.3rem;
}

/* 修复图标容器样式 */
/* .crop-icon {
    background: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.crop-icon i {
    color: var(--white);
    font-size: 1.1rem;
}

.crop-card:hover .crop-icon {
    background: var(--white);
}

.crop-card:hover .crop-icon i,
.crop-card:hover .crop-icon::before {
    color: var(--primary-green);
} */

/* index.css 中备案信息样式 */
.homepage-icp-bar {
    width: 100%;
    padding: 20px 0; /* 上下内边距，增加显示区域 */
    margin-top: 40px; /* 与上方内容拉开距离 */
    background-color: #f8f9fa; /* 浅灰色背景，与页面风格统一 */
    border-top: 1px solid #e9ecef; /* 顶部边框，分隔内容 */
    font-size: 14px; /* 字体大小适配 */
    /* 固定在页面底部（可选：如果需要备案信息始终显示在窗口底部，取消下面注释） */
    /* position: fixed;
    bottom: 0;
    left: 0;
    z-index: 999; */
}

/* 备案链接hover效果 */
.homepage-icp-link:hover {
    color: #28a745 !important; /* 匹配导航栏的绿色主题 */
    text-decoration: underline !important;
}

/* 响应式适配：移动端字体变小，内边距减少 */
@media (max-width: 768px) {
    .homepage-icp-bar {
        padding: 15px 0;
        font-size: 12px;
    }
    .homepage-icp-bar p {
        line-height: 1.8 !important;
    }
}


/* 科研成果展示样式 */
.publications-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.publications-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-gray);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
}

.publications-card .card-header h5 {
    color: var(--black);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.publications-card .card-body {
    padding: 1.5rem;
}

/* 成果分区样式 */
.achievement-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border-gray);
}

.achievement-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(27, 94, 32, 0.05), rgba(27, 94, 32, 0.1));
    border-radius: 6px;
    border-left: 4px solid var(--primary-green);
}

.section-icon {
    margin-right: 0.75rem;
    color: var(--primary-green);
    font-size: 1.1rem;
}

.section-header h6 {
    color: var(--black);
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

/* 学术论文列表样式 */
.publications-list {
    margin-left: 0.5rem;
}

.publication-item {
    display: flex;
    margin-bottom: 1.25rem;
    padding-left: 0.5rem;
}

.publication-item:last-child {
    margin-bottom: 0;
}

.publication-number {
    flex-shrink: 0;
    width: 2.5rem;
    font-weight: 600;
    color: var(--primary-green);
    font-size: 0.9rem;
    padding-top: 0.1rem;
}

.publication-content {
    flex: 1;
}

.publication-content p {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.5;
}

.publication-content em {
    color: var(--text-light);
    font-style: italic;
}

.publication-link {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 0.85rem;
    word-break: break-all;
    display: inline-block;
    margin-top: 0.2rem;
}

.publication-link:hover {
    color: var(--dark-green);
    text-decoration: underline;
}

/* 专利样式 */
.patent-item {
    padding: 0.75rem;
    background: var(--light-gray);
    border-radius: 6px;
    border-left: 3px solid var(--primary-green);
}

.patent-item p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.patent-item strong {
    color: var(--black);
    font-weight: 600;
}

/* 软件著作权样式 */
.software-list {
    margin-left: 0.5rem;
}

.software-item {
    display: flex;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.software-item:hover {
    background: var(--light-gray);
}

.software-item:last-child {
    margin-bottom: 0;
}

.software-number {
    flex-shrink: 0;
    width: 2.5rem;
    font-weight: 600;
    color: var(--primary-green);
    font-size: 0.9rem;
    padding-top: 0.1rem;
}

.software-content {
    flex: 1;
}

.software-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-dark);
}

.software-content strong {
    font-weight: 600;
    color: var(--black);
}

.software-info {
    display: block;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .publications-card .card-body {
        padding: 1.25rem;
    }
    
    .achievement-section {
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
    }
    
    .publication-item {
        flex-direction: column;
        margin-bottom: 1.5rem;
    }
    
    .publication-number {
        width: auto;
        margin-bottom: 0.5rem;
    }
    
    .software-item {
        flex-direction: column;
    }
    
    .software-number {
        width: auto;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .publications-card .card-body {
        padding: 1rem;
    }
    
    .section-header {
        padding: 0.4rem;
    }
    
    .publication-content p {
        font-size: 0.85rem;
    }
    
    .publication-link {
        font-size: 0.8rem;
    }
    
    .patent-item p,
    .software-content p {
        font-size: 0.85rem;
    }
}