/* 图片处理工具页面样式 */

/* 页面标题区 */
.page-header {
    background-color: var(--light-bg);
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 2rem;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #e4eaf1 100%);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--light-text);
    max-width: 700px;
    margin: 0 auto;
}

/* 工具内容区域 */
.tool-content {
    padding: 2rem 0 4rem;
}

/* 工具选项卡 */
.tool-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    /* overflow-x: auto; */
    scrollbar-width: thin;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--light-text);
    position: relative;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tab-btn i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* 工具面板 */
.tool-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tool-panel.active {
    display: block;
}

.tool-description {
    margin-bottom: 2rem;
}

.tool-description h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* 图片上传区域 */
.image-upload-area {
    margin-bottom: 2rem;
}

.upload-box {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-box i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

.upload-box:hover i {
    transform: scale(1.1);
}

.upload-box.dragover {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.upload-btn {
    margin-top: 1rem;
}

/* 工具选项区域 */
.tool-options {
    background-color: var(--light-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.option-group {
    margin-bottom: 1.5rem;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* 滑块样式 */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--light-text);
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 1.5rem;
}

.radio-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-option span {
    transition: color 0.3s ease;
}

.radio-option input:checked ~ span {
    color: var(--primary-color);
    font-weight: 500;
}

.radio-option input:checked ~ span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.radio-option span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* 选择框样式 */
.form-select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 输入框组 */
.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group input {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group span {
    white-space: nowrap;
    color: var(--light-text);
}

.dimension-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.aspect-ratio-lock {
    display: flex;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light-text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

/* 切换开关 */
.toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch input:checked + .switch {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .switch::before {
    transform: translateX(26px);
}

/* 动作按钮 */
.action-buttons {
    text-align: center;
}

.process-btn {
    min-width: 160px;
}

/* 结果区域 */
.results-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    /* display: none; */
}

.results-area h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.result-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.result-item:hover {
    box-shadow: var(--shadow);
}

.result-image {
    background-color: var(--light-bg);
    padding: 1rem;
    text-align: center;
}

.result-image img {
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
}

.result-info {
    padding: 1rem;
}

.result-filename {
    font-weight: 500;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 1rem;
}

.result-stats i {
    margin-right: 0.3rem;
}

.download-btn.success {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* 功能特点区域 */
.tool-features {
    background-color: var(--light-bg);
    padding: 4rem 0;
}

.tool-features h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

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

.feature-item {
    text-align: center;
    padding: 2rem 1rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.feature-item h3 {
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

/* 使用指南 */
.usage-guide {
    padding: 4rem 0;
}

.usage-guide h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    position: relative;
}

/* 连接线 - 仅在桌面视图显示 */
@media (min-width: 992px) {
    .guide-steps::before {
        content: '';
        position: absolute;
        top: 35px;
        left: 0;
        right: 0;
        height: 2px;
        background-color: var(--border-color);
        z-index: 1;
    }
}

.guide-step {
    position: relative;
    padding: 2rem 1rem 1rem;
    text-align: center;
    z-index: 2;
}

.step-number {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 2;
}

.step-content h3 {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .dimension-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aspect-ratio-lock {
        justify-content: center;
        margin: 0.5rem 0;
    }
    
    .tool-features h2,
    .usage-guide h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .tab-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .tab-btn i {
        margin-right: 0.3rem;
    }
}
    