* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    
}
/* 添加移动端适配 */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        padding: 10px;
        min-width: 320px;
    }
    .panel {
        padding: 15px;
        margin-bottom: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .btn {
        padding: 10px 20px;
    }
}
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #06d6a0;
    --danger: #ef476f;
    --light-bg: #f8f9fa;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 20px;
}

h1 {
    font-size: 2.8rem;
    background: linear-gradient(90deg, #4cc9f0, #4361ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    font-weight: 800;
    
}

.subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.6;
}

.app-container {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 25px;
    flex: 1;
}

.panel {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.panel-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(67, 97, 238, 0.3);
    color: #4cc9f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title i {
    font-size: 1.6rem;
}

.upload-area {
    border: 3px dashed rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.3);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.15);
}

.upload-icon {
    font-size: 3.5rem;
    color: #818cf8;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #94a3b8;
}

.btn {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.btn i {
    font-size: 1.2rem;
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-group {
    margin-bottom: 25px;
}

.setting-title {
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
}
.num-value{
    font-weight: bold;
    color: #06d6a0;
}

.slider-container {
    padding: 0 10px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #334155;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(67, 97, 238, 0.5);
}

.value-display {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.image-display-area {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.comparison-container {
    position: relative;
    width: 700px;
    height: 700px; /* 固定容器高度 */

    overflow: hidden;
    border-radius: 16px;
    background: #0f172a;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.comparison-container .pic_tag{
    background: rgba(0,0,0,0.5); 
    color: rgb(190, 190, 190); 
    padding: 3px 8px; 
    border-radius: 4px; 
    font-size: 14px;
}

.comparison-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-align: center;
}

.comparison-before {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    clip-path: inset(0 calc(100% - var(--percent, 50%) * 1%) 0 0);
    will-change: transform;
    z-index: 2;
}
.comparison-before .pic_tag{
    position: absolute; top: 10px; left: 10px; 
}
.comparison-after {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}
.comparison-after .pic_tag{
    position: absolute; top: 10px; right: 10px; 
}
.comparison-before img, 
.comparison-after img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1e293b;
}        

.comparison-after {
    background: #1e293b;
}

.comparison-divider {
    position: absolute;
    top: 0;
    left: calc(var(--percent, 50%) * 1%);
    height: 100%;
    width: 2px;
    background: white;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 3;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: none; /* 默认隐藏滑动条 */
}

.comparison-divider::after {
    content: '↔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}


.empty-state {
    text-align: center;
    padding: 0 20px;
    color: #64748b;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 20px;
    color: #334155;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: #cbd5e1;
}

.empty-state p {
    max-width: 500px;
    line-height: 1.6;
}


.thumbnail-container {
    display: flex;
    gap: 15px;
    padding: 15px;
    /* 关键修改 - 固定最大宽度 */
    max-width: 700px; /* 限制最大父容器宽度 */
    min-height: 120px; /* 限制最小父容器高度 */
    /* 关键修改 - 启用滚动条 */
    overflow-x: auto;
    /* 隐藏滚动条但保留功能（可选） */
    scrollbar-width: thin; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    /* 其他样式保持不变 */
    margin-top: 20px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 16px;
    border: 1px solid var(--border);
}

/* 隐藏WebKit浏览器的滚动条（可选） */
.thumbnail-container::-webkit-scrollbar {
    display: none;
}

/* 缩略图项样式保持不变，但可微调 */
.thumbnail-item {
    min-width: 100px; /* 固定每个缩略图宽度 */
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0; /* 防止缩略图被压缩 */
}
        
.thumbnail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.thumbnail-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.5);
}

.thumbnail-item img {
    width: 100px;
    height: 100%;
    object-fit: cover;
    background: #1e293b;
}

.thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    font-size: 0.7rem;
    text-align: center;
}




.file-details {
    padding: 10px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.detail-item {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.detail-label {
    color: #94a3b8;
}

.detail-value {
    color: white;
    font-weight: 500;
    white-space: normal;
    text-align: right;
    word-wrap: break-word;
    max-width: 170px; /* 根据实际布局调整 */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 最多显示3行 */
    line-clamp: 2; /* 定义标准属性以实现兼容性 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.image-info {

    justify-content: space-between;
    
    color: #cbd5e1;
    font-size: 0.9rem;
    

}

.info-item {
    /* 启用 Flex 布局 */
    display: flex;
    /* 子元素左右分布（两端对齐） */
    justify-content: space-between;
    align-items: center;
    flex: 1;
    padding: 10px;
    margin: 10px 0;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    border: 1px solid var(--border);
    
}

.info-value1, .info-value2, .info-value3{
    font-size: 1.6rem;
    font-weight: bold;
    color: #06d6a0;
}
.info-value2{
    color: #06d6a0;
}
.info-value3{
    color: #4cc9f0;
    
}

.original-label {
    color: #4cc9f0;
}

.compressed-label {
    color: #06d6a0;
}





.stats-panel {
    text-align: center;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 5px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.stat-title {
    color: #94a3b8;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}


.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    
}

.compression-rate {
    color: #06d6a0;
}

.saved-space {
    color: #4cc9f0;
}

.progress-bar {
    height: 8px;
    background: #334155;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.5s ease;
}


footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    color: #64748b;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

@media (max-width: 1400px) {
    .app-container {
        grid-template-columns: 300px 1fr;
    }
    

}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .panel {
        height: auto;
    min-height: 400px;
    }
    
    .comparison-container {
        min-height: 500px;
    }
}

/* 语言切换 */
.language-switch {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: transparent;
    border: 1px solid #4361ee;
    color: #4361ee;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn.active {
    background: #4361ee;
    color: white;
}

.lang-btn:hover {
    background: rgba(67, 97, 238, 0.1);
}