/* 基础重置与通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    line-height: 1.5;
}

/* 导航栏样式 */
.navbar {
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 70px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.logo-text span {
    color: #5FB878;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.menu-toggle:hover {
    background-color: #f5f5f5;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* 导航栏字体加粗和美化 */
.nav-links a {
    color: #555;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600; /* 加粗字体 */
    transition: all 0.3s ease;
    padding: 8px 12px;
    position: relative;
    white-space: nowrap;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.nav-links a:hover {
    color: #5FB878;
    background-color: rgba(95, 184, 120, 0.08);
    transform: translateY(-1px);
}

.nav-links a.active {
    color: #5FB878;
    font-weight: 700;
    background-color: rgba(95, 184, 120, 0.1);
    box-shadow: 0 2px 8px rgba(95, 184, 120, 0.15);
}

.nav-links a.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #5FB878, #2ecc71);
    border-radius: 3px;
}

/* 下拉菜单美化 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #555;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    background: none;
    border: none;
    font-family: inherit;
}

.dropdown-toggle:hover {
    color: #5FB878;
    background-color: rgba(95, 184, 120, 0.08);
    transform: translateY(-1px);
}

.dropdown-icon {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1000;
    top: calc(100% + 5px);
    right: 0;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    animation: fadeInDown 0.3s ease;
    /* 修复：添加透明顶部区域，让鼠标可以平滑移动 */
    padding-top: 5px;
    margin-top: -5px;
}

/* 修复：在.dropdown-content顶部添加一个透明"桥梁"，让鼠标可以从.dropdown平滑移动到下拉菜单 */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
}

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

.dropdown-content a {
    color: #555;
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    text-align: left;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.dropdown-content a i {
    margin-right: 10px;
    color: #5FB878;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: rgba(95, 184, 120, 0.08);
    color: #5FB878;
    padding-left: 25px;
    transform: translateX(2px);
}

/* 修复：优化下拉菜单的显示/隐藏逻辑 */
.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropdown-toggle {
    color: #5FB878;
    background-color: rgba(95, 184, 120, 0.08);
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* 修复：确保鼠标可以从.dropdown移动到.dropdown-content而不中断 */
.dropdown::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: transparent;
    z-index: 1001;
}

/* 修复：鼠标移出.dropdown时的过渡效果 */
.dropdown-content {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 主内容容器 */
.main-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 卡片组件 */
.main-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 30px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.card-header h1 {
    font-size: 28px;
    font-weight: 300;
    margin: 0;
}

.card-header p {
    opacity: 0.9;
    margin-top: 8px;
    font-size: 14px;
}

.card-body {
    padding: 30px;
}

/* 上传区域 */
.upload-section {
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    cursor: pointer;
}

.upload-section:hover {
    border-color: #5FB878;
    background: #f8f9fa;
}

.upload-section i {
    font-size: 48px;
    color: #5FB878;
    margin-bottom: 15px;
}

.upload-section h3 {
    color: #333;
    margin-bottom: 10px;
}

.upload-section p {
    color: #666;
    font-size: 14px;
}

/* 预览区域 */
.preview-container {
    display: none;
    margin-bottom: 30px;
}

.preview-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.preview-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.image-preview {
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 设置面板 */
.settings-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.settings-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.settings-title i {
    margin-right: 10px;
    color: #5FB878;
}

.quality-slider {
    width: 100%;
    margin: 20px 0;
}

.quality-value {
    text-align: center;
    font-size: 24px;
    color: #5FB878;
    font-weight: bold;
    margin: 10px 0;
}

/* 修正对齐问题的表单样式 */
.layui-form-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.layui-form-label {
    width: 100px;
    padding: 9px 5px 9px 0;
    text-align: right;
    font-weight: 400;
    line-height: 20px;
    color: #333;
    white-space: nowrap;
    margin-right: 10px;
    flex-shrink: 0;
}

.layui-form-item .layui-input-block {
    margin-left: 0;
    min-height: 36px;
    line-height: 36px;
    flex: 1;
}

/* 特殊处理质量滑块区域 */
.quality-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 修正最大宽度/高度输入框的对齐 */
.dimension-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.dimension-group {
    display: flex;
    align-items: center;
    flex: 1;
}

.dimension-group .layui-form-label {
    width: 80px;
    padding: 9px 5px 9px 0;
    margin-right: 8px;
    flex-shrink: 0;
}

.dimension-group .layui-input-block {
    margin-left: 0;
    flex: 1;
}

/* 信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.info-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.info-value {
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

.ratio-positive {
    color: #5FB878;
}

.ratio-neutral {
    color: #FFB800;
}

.ratio-negative {
    color: #FF5722;
}

/* 修正按钮对齐 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    align-items: center;
}

.action-buttons .layui-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    height: 50px;
    font-size: 16px;
    padding: 0 20px;
}

.action-buttons .layui-btn i {
    margin-right: 5px;
}

/* 功能特性区域 */
.features-section {
    margin-top: 40px;
}

.features-title {
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

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

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 24px;
}

.feature-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.feature-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* 页脚 */
.footer {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 导航栏响应式 */
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
    }
    
    .logo-area {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 0;
    }
    
    .menu-toggle {
        display: block;
        order: 1;
    }
    
    .nav-links {
        width: 100%;
        display: none; /* 移动端默认隐藏 */
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: 15px;
        padding: 0;
        border-top: 1px solid #eee;
    }
    
    /* 修复：确保.show类的优先级高于默认的display: none */
    .nav-links.show {
        display: flex !important; /* 点击菜单按钮时显示 */
    }
    
    .nav-links a {
        padding: 12px 0;
        text-align: center;
        border-bottom: 1px solid #f5f5f5;
        border-radius: 0;
        font-weight: 500;
        width: 100%;
        display: block;
    }
    
    .nav-links a.active {
        background-color: rgba(95, 184, 120, 0.1);
        font-weight: 600;
    }
    
    .nav-links a.active:after {
        display: none;
    }
    
    /* 移动端下拉菜单 - 修复 */
    .dropdown {
        display: block;
        width: 100%;
    }
    
    /* 移动端移除下拉菜单的透明桥梁 */
    .dropdown::after {
        display: none;
    }
    
    .dropdown-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 12px 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f5f5f5;
        border-radius: 0;
        font-weight: 500;
    }
    
    /* 重要修复：确保下拉内容正确显示 */
    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid #f5f5f5;
        width: 100%;
        min-width: 100%;
        background-color: #f9f9f9;
        border-radius: 0;
        animation: none;
        margin: 0;
        padding: 0;
        padding-top: 0;
        margin-top: 0;
        top: 0;
    }
    
    /* 移动端移除透明桥梁 */
    .dropdown-content::before {
        display: none;
    }
    
    /* 修复：当.dropdown有active类时显示下拉内容 */
    .dropdown.active .dropdown-content {
        display: block !important;
    }
    
    .dropdown-content a {
        padding: 12px 0;
        justify-content: center;
        border-bottom: 1px solid #eee;
        font-size: 14px;
        font-weight: 400;
        text-align: center;
    }
    
    .dropdown-content a i {
        margin-right: 8px;
    }
    
    .dropdown-content a:last-child {
        border-bottom: 1px solid #eee;
    }
    
    .dropdown.active .dropdown-toggle {
        color: #5FB878;
        background-color: rgba(95, 184, 120, 0.1);
        font-weight: 600;
    }
    
    .dropdown.active .dropdown-icon {
        transform: rotate(180deg);
    }
    
    /* 移动端移除悬停效果 */
    .dropdown:hover .dropdown-content {
        display: none;
    }
    
    .dropdown:hover .dropdown-toggle {
        color: #555;
        background-color: transparent;
    }
    
    .dropdown:hover .dropdown-icon {
        transform: none;
    }
    
    /* 修复：防止桌面端样式在移动端干扰 */
    .dropdown-content a:hover {
        background-color: rgba(95, 184, 120, 0.08);
        color: #5FB878;
        padding-left: 20px;
        transform: none;
    }
    
    /* 表单响应式 */
    .layui-form-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .layui-form-label {
        width: 100%;
        text-align: left;
        padding: 9px 0 5px 0;
        margin-bottom: 5px;
    }
    
    .layui-form-item .layui-input-block {
        width: 100%;
    }
    
    .dimension-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .dimension-group {
        width: 100%;
    }
    
    .dimension-group .layui-form-label {
        width: 100px;
        text-align: right;
    }
    
    /* 主内容响应式 */
    .card-body {
        padding: 20px;
    }
    
    .card-header h1 {
        font-size: 24px;
    }
    
    /* 操作按钮响应式 */
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .layui-btn {
        width: 100%;
    }
    
    /* 信息网格响应式 */
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    /* 上传区域响应式 */
    .upload-section {
        padding: 30px 15px;
    }
    
    .upload-section h3 {
        font-size: 18px;
    }
    
    /* 功能特性响应式 */
    .features-title {
        font-size: 20px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    /* 修复：防止移动端点击下拉菜单时触发链接 */
    .dropdown-toggle {
        pointer-events: auto;
    }
    
    /* 修复：确保下拉菜单在移动端层级正确 */
    .dropdown-content {
        z-index: 1001;
    }
}

/* 超大屏幕适配 */
@media (min-width: 1200px) {
    .main-container {
        padding: 0;
    }
    
    .nav-container {
        padding: 0;
    }
}

/* 图片对比滑块样式 - 添加.hk-特定标识 */
        .hk-image-comparison-container {
            position: relative;
            width: 100%;
            max-width: 800px;
            margin: 0 auto;
            overflow: hidden;
            border-radius: 8px;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
        }
        
        .hk-image-wrapper {
            position: relative;
            width: 100%;
            padding-top: 75%; /* 4:3 比例，可以根据需要调整 */
            overflow: hidden;
        }
        
        .hk-image-comparison-container img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            pointer-events: none;
        }
        
        .hk-before-image {
            z-index: 2;
            clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
        }
        
        .hk-after-image {
            z-index: 1;
        }
        
        .hk-slider-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 3;
        }
        
        .hk-slider-line {
            position: absolute;
            top: 0;
            left: 50%;
            width: 2px;
            height: 100%;
            background-color: #fff;
            transform: translateX(-50%);
            cursor: ew-resize;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
        }
        
        .hk-slider-button {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 50px;
            height: 50px;
            background-color: #fff;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 15px rgba(0,0,0,0.3);
            transition: all 0.3s ease;
        }
        
        .hk-slider-button:hover {
            transform: translate(-50%, -50%) scale(1.1);
        }
        
        .hk-slider-button i {
            font-size: 20px;
            color: #666;
        }
        
        .hk-image-labels {
            position: absolute;
            top: 20px;
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding: 0 20px;
            z-index: 4;
            pointer-events: none;
        }
        
        .hk-before-label, .hk-after-label {
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 16px;
            font-weight: bold;
        }
        
        .hk-before-label {
            margin-right: auto;
        }
        
        .hk-after-label {
            margin-left: auto;
        }
        
        .hk-comparison-instructions {
            text-align: center;
            margin-top: 20px;
            color: #666;
            font-size: 14px;
        }
        
        /* 移动端适配 */
        @media (max-width: 768px) {
            .hk-slider-button {
                width: 40px;
                height: 40px;
            }
            
            .hk-slider-button i {
                font-size: 16px;
            }
            
            .hk-image-labels {
                padding: 0 10px;
            }
            
            .hk-before-label, .hk-after-label {
                padding: 6px 12px;
                font-size: 14px;
            }
}

