/* 图片压缩工具样式 */
.image-compressor-section {
    padding: 40px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* 工作区样式 */
.workspace {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 60px;
}

/* 上传面板 */
.upload-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.upload-info {
    font-size: 0.9rem;
    color: #666;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #4dabf7;
    background: rgba(77, 171, 247, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: #999;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 20px;
}

.upload-btn {
    background: #4dabf7;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: #3b82f6;
}

.upload-list {
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.upload-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.upload-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
}

.upload-item-info {
    flex: 1;
}

.upload-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item-size {
    font-size: 0.8rem;
    color: #666;
}

.upload-item-remove {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.upload-item-remove:hover {
    background: rgba(255, 71, 87, 0.1);
    transform: scale(1.1);
}

/* 设置面板 */
.settings-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-control input[type="range"] {
    flex: 1;
}

.setting-control span {
    min-width: 40px;
    font-size: 0.9rem;
    color: #666;
}

.setting-item select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    transition: border-color 0.3s ease;
}

.setting-item select:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 2px rgba(77, 171, 247, 0.2);
}

.size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.size-inputs div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.size-inputs input[type="number"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.size-inputs input[type="number"]:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 2px rgba(77, 171, 247, 0.2);
}

.size-inputs label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.primary {
    background: #4dabf7;
    color: white;
}

.action-btn.primary:hover {
    background: #3b82f6;
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: #e9ecef;
    color: #495057;
}

.action-btn.secondary:hover {
    background: #dee2e6;
}

/* 预览面板 */
.preview-panel {
    grid-column: 1 / -1;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preview-info {
    font-size: 0.9rem;
    color: #666;
}

.preview-content {
    margin-top: 20px;
}

.preview-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-name {
    font-weight: 600;
    color: #333;
}

.preview-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #666;
}

.preview-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

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

.preview-image h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1rem;
}

.preview-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-image p {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
}

.preview-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.download-btn:hover {
    background: #218838;
}

/* 功能说明区 */
.feature-section {
    margin-bottom: 60px;
}

.feature-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

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

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: #e3f2fd;
    transform: translateY(-2px);
}

.feature-item i {
    color: #4dabf7;
    font-size: 1.2rem;
}

.feature-item span {
    color: #495057;
    font-weight: 500;
}

/* 使用教程 */
.tutorial-section {
    margin-bottom: 60px;
}

.tutorial-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tutorial-step {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.tutorial-step:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 40px;
    height: 40px;
    background: #4dabf7;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

/* FAQ部分 */
.faq-section {
    margin-bottom: 60px;
}

.faq-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faq-question {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-answer {
    color: #666;
    line-height: 1.6;
}

/* 相关工具 */
.related-section {
    margin-top: 60px;
}

.related-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 25px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.tool-link:hover {
    background: #4dabf7;
    color: white;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .upload-area {
        padding: 30px;
    }

    .preview-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tutorial-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .step-number {
        margin-bottom: 10px;
    }
}

/* 深色主题 */
body.dark-theme .image-compressor-section {
    background: #1a1a1a;
}

body.dark-theme .page-title {
    color: #e0e0e0;
}

body.dark-theme .page-subtitle {
    color: #aaa;
}

body.dark-theme .upload-panel,
body.dark-theme .settings-panel,
body.dark-theme .preview-panel {
    background: #2d2d2d;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-theme .panel-header h3 {
    color: #e0e0e0;
}

body.dark-theme .upload-info {
    color: #999;
}

body.dark-theme .upload-area {
    border-color: #444;
}

body.dark-theme .upload-area:hover {
    border-color: #4dabf7;
    background: rgba(77, 171, 247, 0.1);
}

body.dark-theme .upload-icon {
    color: #777;
}

body.dark-theme .upload-text {
    color: #ccc;
}

body.dark-theme .upload-hint {
    color: #888;
}

body.dark-theme .upload-item {
    background: #3a3a3a;
    border-color: #444;
}

body.dark-theme .upload-item-name {
    color: #e0e0e0;
}

body.dark-theme .upload-item-size {
    color: #999;
}

body.dark-theme .setting-item label {
    color: #ccc;
}

body.dark-theme .setting-item select {
    background: #444;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .size-inputs input[type="number"] {
    background: #444;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .action-btn.secondary {
    background: #444;
    color: #ccc;
}

body.dark-theme .action-btn.secondary:hover {
    background: #555;
}

body.dark-theme .preview-info {
    color: #999;
}

body.dark-theme .preview-item {
    background: #3a3a3a;
    border-color: #444;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-theme .preview-name {
    color: #e0e0e0;
}

body.dark-theme .preview-stats {
    color: #999;
}

body.dark-theme .preview-image h4 {
    color: #e0e0e0;
}

body.dark-theme .preview-image img {
    border-color: #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-theme .preview-image p {
    color: #999;
}

body.dark-theme .feature-section h3,
body.dark-theme .tutorial-section h3,
body.dark-theme .faq-section h3,
body.dark-theme .related-section h3 {
    color: #e0e0e0;
}

body.dark-theme .feature-item {
    background: #2d2d2d;
}

body.dark-theme .feature-item:hover {
    background: rgba(77, 171, 247, 0.2);
}

body.dark-theme .feature-item span {
    color: #ccc;
}

body.dark-theme .tutorial-step {
    background: #2d2d2d;
}

body.dark-theme .step-content h4 {
    color: #e0e0e0;
}

body.dark-theme .step-content p {
    color: #aaa;
}

body.dark-theme .faq-item {
    background: #2d2d2d;
}

body.dark-theme .faq-question {
    color: #e0e0e0;
}

body.dark-theme .faq-answer {
    color: #aaa;
}

body.dark-theme .tool-link {
    background: #2d2d2d;
    color: #ccc;
}

body.dark-theme .tool-link:hover {
    background: #4dabf7;
    color: white;
}