:root {
    --primary-color: #007AFF;
    --background-color: #F5F5F7;
    --surface-color: #FFFFFF;
    --text-color: #1D1D1F;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    color: #86868B;
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    background-color: var(--surface-color);
    border: 2px dashed #DEDEDE;
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.upload-icon {
    fill: #DEDEDE;
    margin-bottom: 1rem;
    transition: fill 0.3s ease;
}

.upload-area:hover .upload-icon {
    fill: var(--primary-color);
}

.compression-controls {
    display: none;
}

.quality-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    height: 4px;
    background: #DEDEDE;
    border-radius: 2px;
    appearance: none;
}

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

.format-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.format-control select {
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #DEDEDE;
    background-color: white;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.format-control select:focus {
    border-color: var(--primary-color);
}

.corner-control {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #DEDEDE;
}

.radius-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.radius-control input[type="range"] {
    flex: 1;
    height: 4px;
    background: #DEDEDE;
    border-radius: 2px;
    appearance: none;
}

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

.corner-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.corner-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.corner-input input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #DEDEDE;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
}

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

.corner-input span {
    font-size: 0.8rem;
    color: #86868B;
}

.preview-section {
    margin-top: 2rem;
}

.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.preview-box {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.preview-box h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.image-preview {
    width: 100%;
    height: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #F5F5F7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview img[src] {
    opacity: 1;
}

.placeholder-icon {
    fill: #DEDEDE;
    transition: opacity 0.3s ease;
}

.image-preview img[src] + .placeholder-icon {
    opacity: 0;
}

.file-info {
    margin-top: 1rem;
    color: #86868B;
}

.download-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.download-btn:disabled {
    background-color: #DEDEDE;
    cursor: not-allowed;
}

.download-btn:hover:not(:disabled) {
    background-color: #0066CC;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .corner-inputs {
        grid-template-columns: repeat(2, 1fr);
    }
}

.format-hint {
    color: #86868B;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.size-control {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #DEDEDE;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.size-inputs input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #DEDEDE;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
}

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

.size-inputs span {
    color: #86868B;
    font-size: 0.9rem;
}

.reset-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-btn svg {
    fill: #86868B;
    transition: fill 0.3s ease;
}

.reset-btn:hover svg {
    fill: var(--primary-color);
}

.control-panel {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.control-section {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.quality-control,
.radius-control,
.size-control,
.format-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

.quality-control:last-child,
.radius-control:last-child,
.size-control:last-child,
.format-control:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.slider-controls-row {
    display: flex;
    gap: 20px;
    /* margin-bottom: 10px; */
    position: relative;
    padding-bottom: 15px;
}

.slider-controls-row::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 1px;
    /* background-color: #DEDEDE; */
}

.controls-row {
    margin-top: 15px;
}

.quality-control,
.radius-control {
    flex: 1;
    min-width: 0;
}

.quality-control input[type="range"],
.radius-control input[type="range"] {
    width: 100%;
}

.size-control {
    flex: 2;
}

.format-control {
    flex: 1;
    min-width: 150px;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.size-inputs input {
    width: 70px;
}

@media (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .size-control,
    .format-control {
        width: 100%;
    }
}

.controls-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: center;
}

.size-control {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.format-control {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin: 0;
}

/* Add ad container styles */
.ad-container {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 250px;
    z-index: 100;
    display: none;
    background: #f5f5f7;
    border-radius: 12px;
    overflow: hidden;
}

/* Add this for testing - remove in production */
.ad-container::after {
    content: 'Google Ads 300x250';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 14px;
}

.ad-left {
    left: 20px; /* Increased margin for better visibility */
}

.ad-right {
    right: 20px;
}

/* Only show ads on screens wide enough */
@media (min-width: 1820px) {
    .ad-container {
        display: block;
    }
}

/* Language selector styles */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-btn {
    background: var(--surface-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 100px;
}

.language-btn i {
    font-size: 20px;
}

.language-btn:hover {
    background: #f5f5f7;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    overflow-y: auto;
    max-height: 400px;
    min-width: 180px;
    scrollbar-width: thin;
    scrollbar-color: #999 transparent;
}

.language-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #999 transparent;
}

.language-dropdown::-webkit-scrollbar {
    width: 6px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background-color: #999;
    border-radius: 3px;
}

.language-dropdown.show {
    display: block;
}

.language-dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.language-dropdown a:hover {
    background-color: #f5f5f7;
}

.current-lang {
    font-weight: 500;
    font-size: 16px;
}

/* 副标题样式 */
.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* 使用说明部分 */
.instructions {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.instructions h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

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

.step {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.step h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* FAQ部分 */
.faq {
    margin: 3rem 0;
    padding: 2rem;
}

.faq h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.faq-items {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

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

/* 页脚样式 */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    background: #f8f9fa;
    text-align: center;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .instruction-steps {
        grid-template-columns: 1fr;
    }
    
    .instructions, .faq {
        padding: 1rem;
    }
}