/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
}

/* 动态海洋科技风背景 */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a192f, #112940, #0f3460);
    overflow: hidden;
    z-index: -1;
}
.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    border-radius: 45%;
    background: rgba(30, 136, 229, 0.1);
    animation: wave 20s linear infinite;
}
.wave:nth-child(1) {
    top: -150%;
    left: -50%;
    animation-duration: 15s;
}
.wave:nth-child(2) {
    top: -140%;
    left: -50%;
    animation-duration: 25s;
    animation-delay: 2s;
}
.wave:nth-child(3) {
    top: -130%;
    left: -50%;
    animation-duration: 20s;
    animation-delay: 5s;
}
.glow-point {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(100, 181, 246, 0.8);
    border-radius: 50%;
    animation: glow 3s infinite alternate;
}
@keyframes wave {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(100, 181, 246, 0.5); }
    100% { box-shadow: 0 0 15px rgba(100, 181, 246, 0.9); }
}

/* 头部导航 */
header {
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(66, 165, 245, 0.3);
}
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}
.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.logo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.logo-text {
    color: #e3f2fd;
    font-size: 24px;
    font-weight: 700;
}
.nav-menu {
    display: flex;
    gap: 30px;
}
.nav-item {
    color: #bbdefb;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}
.nav-item:hover {
    color: #e3f2fd;
    background: rgba(66, 165, 245, 0.2);
}
.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #42a5f5;
    transition: width 0.3s ease;
}
.nav-item:hover::after {
    width: 100%;
}
.nav-item.active {
    color: #e3f2fd;
    background: rgba(66, 165, 245, 0.2);
}
.nav-item.active::after {
    width: 100%;
}
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    color: #e3f2fd;
    background: none;
    border: none;
    cursor: pointer;
}

/* 页面主体样式 */
.ai-main {
    width: 90%;
    margin: 40px auto;
    padding-bottom: 80px;
}

/* 页面标题区 */
.ai-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}
.ai-title {
    color: #e3f2fd;
    font-size: 32px;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(30, 136, 229, 0.4);
}
.ai-subtitle {
    color: #bbdefb;
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 核心功能区 */
.ai-core {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-bottom: 50px;
}

/* 通用卡片样式 */
.card-title {
    color: #e3f2fd;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(66, 165, 245, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i {
    color: #42a5f5;
    font-size: 20px;
}
.upload-card, .setting-card, .result-card, .history-card {
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(66, 165, 245, 0.3);
    padding: 25px;
    margin-bottom: 30px;
}

/* 左侧操作区 */
.upload-container {
    background: rgba(10, 25, 47, 0.4);
    border: 2px dashed rgba(66, 165, 245, 0.3);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}
.upload-container:hover {
    border-color: #42a5f5;
    background: rgba(10, 25, 47, 0.5);
}
.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    cursor: pointer;
}
.upload-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #42a5f5;
    font-size: 40px;
    transition: all 0.3s ease;
}
.upload-container:hover .upload-icon {
    background: rgba(66, 165, 245, 0.2);
    transform: scale(1.1);
}
.upload-text {
    color: #bbdefb;
    font-size: 16px;
}
.upload-hint {
    font-size: 14px;
    color: #90caf9;
    margin-top: 8px;
}
.upload-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.upload-btn {
    padding: 10px 24px;
    background: rgba(66, 165, 245, 0.1);
    color: #42a5f5;
    border: 1px solid rgba(66, 165, 245, 0.3);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.upload-btn:hover {
    background: #2196f3;
    color: #fff;
    border-color: #2196f3;
}

/* 预览图片样式 */
.preview-container {
    position: relative;
    background: rgba(10, 25, 47, 0.4);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}
.preview-image {
    width: 100%;
    height: auto;
    display: block;
}
.remove-image {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(10, 25, 47, 0.8);
    border: none;
    color: #bbdefb;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.remove-image:hover {
    background: #ef5350;
    color: #fff;
}

/* 设置卡片样式 */
.setting-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-label {
    color: #e3f2fd;
    font-size: 16px;
    font-weight: 500;
}
.form-select {
    background: rgba(10, 25, 47, 0.8);
    border: 1px solid rgba(66, 165, 245, 0.3);
    color: #e3f2fd;
    padding: 10px 15px;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}
.form-select option {
    background: #0a192f;
}
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.checkbox-item {
    color: #bbdefb;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.checkbox-item input {
    accent-color: #2196f3;
    width: 16px;
    height: 16px;
}
.form-textarea {
    background: rgba(10, 25, 47, 0.8);
    border: 1px solid rgba(66, 165, 245, 0.3);
    color: #e3f2fd;
    padding: 10px 15px;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    resize: none;
    min-height: 100px;
}
.form-textarea::placeholder {
    color: #90caf9;
    opacity: 0.7;
}
.diagnose-btn {
    padding: 12px 0;
    background: #2196f3;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}
.diagnose-btn:disabled {
    background: rgba(66, 165, 245, 0.2);
    cursor: not-allowed;
}
.diagnose-btn:not(:disabled):hover {
    background: #1976d2;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(33, 150, 243, 0.3);
}

/* 右侧结果区 */
.result-card {
    min-height: 420px;
}
.no-result, .diagnosing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 320px;
    gap: 25px;
    color: #bbdefb;
}
.no-result-icon, .loading-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #42a5f5;
    font-size: 40px;
}
.loading-icon i {
    animation: spin 2s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.no-result-text, .loading-text {
    text-align: center;
    font-size: 16px;
}
.no-result-text p:last-child, .loading-text p:last-child {
    font-size: 14px;
    color: #90caf9;
    margin-top: 8px;
}

/* 诊断结果内容 */
.result-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(66, 165, 245, 0.2);
}
.result-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
}
.success {
    color: #4caf50;
}
.diagnose-time {
    color: #90caf9;
    font-size: 14px;
}
.result-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.disease-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.disease-title {
    color: #e3f2fd;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.confidence {
    color: #42a5f5;
    font-size: 14px;
    font-weight: normal;
}
.disease-desc {
    color: #bbdefb;
    font-size: 14px;
    line-height: 1.6;
    padding: 15px;
    background: rgba(10, 25, 47, 0.4);
    border-radius: 8px;
}
.treatment-plan {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.plan-title {
    color: #e3f2fd;
    font-size: 16px;
}
.plan-list {
    color: #bbdefb;
    font-size: 14px;
    line-height: 1.8;
    padding-left: 20px;
}
.plan-list li {
    margin-bottom: 8px;
}
.plan-list li:last-child {
    margin-bottom: 0;
}
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}
.result-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.result-btn:nth-child(1) {
    background: rgba(66, 165, 245, 0.1);
    color: #42a5f5;
    border: 1px solid rgba(66, 165, 245, 0.3);
}
.result-btn:nth-child(1):hover {
    background: rgba(66, 165, 245, 0.2);
    color: #e3f2fd;
}
.result-btn:nth-child(2) {
    background: #2196f3;
    color: #fff;
}
.result-btn:nth-child(2):hover {
    background: #1976d2;
}
.result-btn:nth-child(3) {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.result-btn:nth-child(3):hover {
    background: #4caf50;
    color: #fff;
}

/* 历史记录卡片 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 10px;
}
.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.4);
    border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(66, 165, 245, 0.3);
    border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb:hover {
    background: #42a5f5;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(10, 25, 47, 0.4);
    border-radius: 8px;
    transition: all 0.3s ease;
}
.history-item:hover {
    background: rgba(10, 25, 47, 0.5);
    border: 1px solid rgba(66, 165, 245, 0.3);
}
.history-img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
}
.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.history-title {
    color: #e3f2fd;
    font-size: 16px;
    font-weight: 500;
}
.history-time {
    color: #90caf9;
    font-size: 12px;
}
.history-result {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}
.result-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.result-tag.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}
.history-actions {
    display: flex;
    gap: 10px;
}
.history-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #90caf9;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.history-btn:hover {
    background: rgba(66, 165, 245, 0.1);
    color: #e3f2fd;
}
.history-btn.delete-btn:hover {
    color: #ef5350;
}
.view-more-history {
    display: block;
    text-align: center;
    color: #42a5f5;
    text-decoration: none;
    font-size: 14px;
    margin-top: 15px;
    transition: all 0.3s ease;
}
.view-more-history:hover {
    color: #e3f2fd;
    text-decoration: underline;
}

/* 常见病害识别库 */
.disease-library {
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(66, 165, 245, 0.3);
    padding: 25px;
}
.library-title {
    color: #e3f2fd;
    font-size: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.library-title i {
    color: #42a5f5;
    font-size: 24px;
}
.disease-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.disease-item {
    background: rgba(10, 25, 47, 0.4);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}
.disease-item:hover {
    transform: translateY(-5px);
    border: 1px solid rgba(66, 165, 245, 0.5);
    box-shadow: 0 10px 20px rgba(30, 136, 229, 0.15);
}
.disease-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-bottom: 1px solid rgba(66, 165, 245, 0.1);
}
.disease-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.disease-name {
    color: #e3f2fd;
    font-size: 16px;
    font-weight: 500;
}
.disease-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.disease-tag {
    font-size: 12px;
    padding: 3px 8px;
    background: rgba(66, 165, 245, 0.1);
    color: #90caf9;
    border-radius: 10px;
}

/* 底部样式 */
footer {
    width: 100%;
    padding: 40px 5%;
    background: rgba(10, 25, 47, 0.8);
    border-top: 1px solid rgba(66, 165, 245, 0.3);
    margin-top: 80px;
}
.footer-content {
    color: #bbdefb;
    text-align: center;
    font-size: 14px;
    line-height: 1.8;
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .ai-core {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100px;
        right: 5%;
        background: rgba(10, 25, 47, 0.9);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        padding: 20px;
        border: 1px solid rgba(66, 165, 245, 0.3);
        z-index: 999;
    }
    .nav-menu.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
    .ai-header {
        margin-bottom: 30px;
    }
    .ai-title {
        font-size: 28px;
    }
    .upload-container {
        padding: 30px 15px;
    }
    .upload-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    .upload-actions {
        flex-direction: column;
        gap: 10px;
    }
    .upload-btn {
        width: 100%;
    }
    .result-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    .disease-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
@media (max-width: 480px) {
    .ai-subtitle {
        font-size: 16px;
    }
    .upload-card, .setting-card, .result-card, .history-card {
        padding: 15px;
    }
    .card-title {
        font-size: 16px;
    }
    .disease-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .history-actions {
        align-self: flex-end;
    }
}