:root {
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --secondary-color: #64748B;
    --success-color: #059669;
    --danger-color: #DC2626;
    --background-color: #F8FAFC;
    --card-background: #FFFFFF;
    --border-radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--background-color);
    color: #1F2937;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.app-header {
    text-align: center;
    margin-bottom: 48px;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* 上传区域样式 */
.upload-area {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 48px;
    text-align: center;
    border: 2px dashed #E5E7EB;
    transition: all 0.3s ease;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #F8FAFC;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.upload-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.upload-trigger {
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    display: inline;
}

.upload-trigger:hover {
    color: var(--primary-hover);
}

.upload-tip {
    color: var(--secondary-color);
    font-size: 1rem;
    margin: 8px 0;
}

.upload-formats {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* 压缩选项样式 */
.compression-options {
    margin-bottom: 32px;
}

.option-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.option-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.option-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}

.option-content {
    padding: 24px;
}

.control-group {
    margin-bottom: 24px;
}

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

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.toggle-group {
    display: flex;
    gap: 8px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6B7280;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: white;
    color: #111827;
    box-shadow: var(--shadow-sm);
}

.slider {
    width: 100%;
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    width: 100%;
}

.format-option {
    flex: 1;
    min-width: 100px;
}

.format-option input[type="radio"] {
    display: none;
}

.format-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #F3F4F6;
    border: 2px solid transparent;
    border-radius: 12px;
    color: #6B7280;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.format-option input[type="radio"]:checked + span {
    background: #EEF2FF;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.format-option:hover span {
    background: #E5E7EB;
    color: #374151;
    transform: translateY(-1px);
}

/* 预览区域样式 */
.preview-section {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 32px;
    overflow: hidden;
}

.preview-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    padding: 24px;
}

.image-card {
    background: #F8FAFC;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.image-preview {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.image-info {
    padding: 12px;
}

.image-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.compression-stats {
    display: flex;
    justify-content: space-around;
    padding: 24px;
    background: #F8FAFC;
    border-top: 1px solid #E5E7EB;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}

/* 目标大小选择器样式 */
.size-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    width: 100%;
}

.size-option {
    position: relative;
    cursor: pointer;
}

.size-option input[type="radio"] {
    display: none;
}

.size-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #F3F4F6;
    border: 2px solid transparent;
    border-radius: 12px;
    color: #6B7280;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.size-option:hover span {
    background: #E5E7EB;
    color: #374151;
    transform: translateY(-1px);
}

.size-option input[type="radio"]:checked + span {
    background: #EEF2FF;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.size-option input[type="radio"]:checked + span::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--primary-color);
    border-radius: 14px;
    opacity: 0.1;
    pointer-events: none;
}

.size-option input[type="radio"]:checked + span::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* 新的按钮样式 */
.action-btn {
    position: relative;
    padding: 0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-btn:hover::before {
    opacity: 1;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    position: relative;
    z-index: 1;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.action-btn.secondary {
    background: #F8FAFC;
    color: #1F2937;
    border: 2px solid #E5E7EB;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.action-btn.secondary:hover {
    transform: translateY(-2px);
    border-color: #D1D5DB;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.action-btn:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    border-color: transparent;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.action-btn:disabled::before {
    display: none;
}

.action-btn:disabled .btn-icon {
    opacity: 0.5;
}

/* 添加按钮点击效果 */
.action-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 图片卡片样式更新 */
.image-preview-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-wrapper:hover .image-overlay {
    opacity: 1;
}

.image-preview-wrapper:hover .image-preview {
    transform: scale(1.05);
}

.card-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.card-btn .btn-icon {
    width: 16px;
    height: 16px;
}

.card-btn.compress-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
}

.card-btn.compress-btn:hover {
    background: white;
    transform: translateY(-2px);
}

.card-btn.delete-btn {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.card-btn.delete-btn:hover {
    background: rgb(239, 68, 68);
    transform: translateY(-2px);
}

.image-info {
    padding: 12px;
}

.image-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1F2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size {
    font-size: 0.8rem;
    color: var(--secondary-color);
    display: flex;
    gap: 4px;
}

.compressed-size {
    color: var(--success-color);
}

/* 更新尺寸调整控件样式 */
.dimension-controls {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 16px;
}

.dimension-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.input-group {
    flex: 1;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 36px 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.input-wrapper input::placeholder {
    color: #9CA3AF;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.input-wrapper .unit {
    position: absolute;
    right: 12px;
    color: var(--secondary-color);
    font-size: 0.85rem;
    pointer-events: none;
}

.dimension-separator {
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.lock-ratio {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-ratio input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.lock-background {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 2px solid #E5E7EB;
    z-index: 1;
}

.lock-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    pointer-events: none;
}

/* 锁定状态 */
.lock-ratio input:checked ~ .lock-background {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.lock-ratio input:checked ~ .lock-icon.locked {
    opacity: 1;
    transform: scale(1);
    color: white;
}

.lock-ratio input:checked ~ .lock-icon.unlocked {
    opacity: 0;
    transform: scale(0.8);
}

/* 解锁状态 */
.lock-ratio input:not(:checked) ~ .lock-icon.locked {
    opacity: 0;
    transform: scale(0.8);
}

.lock-ratio input:not(:checked) ~ .lock-icon.unlocked {
    opacity: 1;
    transform: scale(1);
    color: var(--secondary-color);
}

/* 悬停效果 */
.lock-ratio:hover {
    transform: translateY(-2px);
}

.lock-ratio:hover .lock-background {
    border-color: var(--primary-color);
}

/* 激活状态 */
.lock-ratio:active {
    transform: translateY(1px);
}

/* 添加内发光效果 */
.lock-ratio input:checked ~ .lock-background::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    background: linear-gradient(to bottom right, 
        rgba(255, 255, 255, 0.2), 
        rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.25s;
}

.lock-ratio:hover input:checked ~ .lock-background::after {
    opacity: 1;
}

/* 添加输入框占位符样式 */
.input-wrapper input::placeholder {
    color: #9CA3AF;
}

/* 添加输入框数字调节按钮样式 */
.input-wrapper input::-webkit-inner-spin-button,
.input-wrapper input::-webkit-outer-spin-button {
    opacity: 0;
    height: 28px;
    position: absolute;
    right: 24px;
    cursor: pointer;
}

.input-wrapper:hover input::-webkit-inner-spin-button,
.input-wrapper:hover input::-webkit-outer-spin-button {
    opacity: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #E5E7EB;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

/* 更新锁定/解锁按钮样式，增加特异性 */
.dimension-controls .dimension-separator {
    display: flex;
    align-items: center;
    padding: 0 12px;
    position: relative;
}

.dimension-controls .lock-ratio {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.dimension-controls .lock-ratio input {
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.dimension-controls .lock-background {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 2px solid #E5E7EB;
    z-index: 1;
}

.dimension-controls .lock-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

/* 锁定状态 */
.dimension-controls .lock-ratio input:checked ~ .lock-background {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.dimension-controls .lock-ratio input:checked ~ .lock-icon.locked {
    opacity: 1;
    transform: scale(1);
    color: white;
}

.dimension-controls .lock-ratio input:checked ~ .lock-icon.unlocked {
    opacity: 0;
    transform: scale(0.8);
}

/* 解锁状态 */
.dimension-controls .lock-ratio input:not(:checked) ~ .lock-icon.locked {
    opacity: 0;
    transform: scale(0.8);
}

.dimension-controls .lock-ratio input:not(:checked) ~ .lock-icon.unlocked {
    opacity: 1;
    transform: scale(1);
    color: var(--secondary-color);
}

/* 悬停效果 */
.dimension-controls .lock-ratio:hover {
    transform: translateY(-2px);
}

.dimension-controls .lock-ratio:hover .lock-background {
    border-color: var(--primary-color);
}

/* 激活状态 */
.dimension-controls .lock-ratio:active {
    transform: translateY(1px);
}

/* 输入框样式增强 */
.dimension-controls .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.dimension-controls .input-wrapper input {
    width: 100%;
    padding: 12px 36px 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.dimension-controls .input-wrapper .unit {
    position: absolute;
    right: 12px;
    color: var(--secondary-color);
    font-size: 0.85rem;
    pointer-events: none;
} 