/* 头部区域样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 修复：覆盖全局 header-actions 的 absolute 定位 */
.header .header-actions {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 工具标题样式 */
.tool-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: #1d1d1f;
}

/* 主内容布局 */
.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.left-section {
    flex: 1;
    max-width: 600px;
}

.right-section {
    flex: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
}

/* 图片信息显示 */
.image-info {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: fit-content;
    max-height: 70vh;
    overflow-y: auto;
}

/* 选项卡容器 */
.tab-container {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

/* 选项卡按钮 */
.tab-button {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f8f9fa;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #e9ecef;
}

.tab-button.active {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* 图片信息内容区 */
.image-info-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* 缩略图容器 */
.thumbnail-container {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-info-content {
        flex-direction: column;
        align-items: center;
    }
    
    .thumbnail-container {
        width: 100px;
        height: 100px;
    }
}

.image-info h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

/* 图片选择器 */
.image-selector {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.image-selector label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.image-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

/* 图片分隔线 */
.image-separator {
    height: 1px;
    background-color: #e0e0e0;
    margin: 15px 0;
}

/* 图片标题 */
.image-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.info-label {
    font-weight: 500;
    color: #666;
}

.info-value {
    color: #333;
    font-family: 'Courier New', monospace;
}

.info-item:last-child {
    margin-bottom: 0;
}

/* 返回按钮 */
.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

/* 返回按钮样式 */
.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 36px;
    box-sizing: border-box;
}

.back-btn:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

/* 收藏按钮样式 */
.favorite-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 36px;
    box-sizing: border-box;
    font-family: inherit;
}

.favorite-button:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.favorite-button.favorited {
    background-color: #fff8e1;
    color: #f9a825;
}

.favorite-button.favorited:hover {
    background-color: #ffecb3;
    color: #f57f17;
}

/* 工具设置 */
.tool-settings {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.setting-item label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.setting-item input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.setting-item input:focus {
    outline: none;
    border-color: #3498db;
}

.setting-item select {
    width: 140px;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.setting-item select:focus {
    outline: none;
    border-color: #3498db;
}

.setting-item .unit {
    font-size: 14px;
    color: #666;
}

/* 拖放区域 */
.drop-zone {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.drop-zone-content i {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.drop-zone:hover i,
.drop-zone.dragover i {
    color: #3498db;
}

.drop-zone-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.selected-count {
    font-size: 14px;
    color: #95a5a6;
    margin-top: 10px;
    font-weight: bold;
}

.selected-count.has-files {
    color: #27ae60;
}

.selected-count.has-files #selectedNumber {
    color: #e74c3c;
    font-size: 18px;
    font-weight: bold;
    margin: 0 4px;
}

#selectedNumber {
    font-weight: bold;
    margin: 0 4px;
}

/* 压缩按钮 */
.btn-compress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 清空按钮 */
.btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

.btn-clear:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-compress:hover {
    background-color: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

.btn-compress:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 提示信息 */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin-bottom: 10px;
}

.notice i {
    font-size: 18px;
    color: #3498db;
    margin-top: 2px;
}

.notice p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 压缩结果 */
.tool-results {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.tool-results h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.result-preview {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 12px;
    background-color: #f5f7fa;
}

.result-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.btn-download:hover {
    background-color: #2980b9;
}

/* 工具说明 */
.tool-description {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    flex: 0 0 100%;
}

.tool-description h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
}

.tool-description p {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .back-btn,
    .favorite-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    body > .container {
        padding: 15px;
    }
    
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .left-section, .right-section {
        max-width: 100%;
    }
    
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .back-btn {
        padding: 8px 14px;
        font-size: 13px;
        height: 36px;
    }
    
    .favorite-button {
        padding: 8px 14px;
        font-size: 13px;
        height: 36px;
    }
    
    .tool-settings {
        flex-direction: column;
        gap: 12px;
    }
    
    .setting-item {
        justify-content: space-between;
    }
    
    .drop-zone {
        padding: 40px 16px;
    }
    
    .drop-zone-content i {
        font-size: 36px;
    }
    
    .results-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 24px;
    }
    
    .tool-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-like, .btn-favorite {
        flex: 1;
        justify-content: center;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .setting-item input {
        width: 100%;
    }
}