/* --- 多语言CSS规则 --- */
html[lang="en"] span[lang="zh"] {
    display: none;
}
html[lang="zh"] span[lang="en"] {
    display: none;
}
/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #409EFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #606266;
    font-size: 16px;
    margin: 0;
}

/* --- 页面原有样式 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    /* 优化网络较慢地区的加载体验 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
#app {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.lang-switcher-container {
    text-align: right;
    margin-bottom: 15px; /* Add space below the switcher */
}

/* 页面标题区域 */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.app-name {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

/* 移动端广告优化 */
@media (max-width: 768px) {    
    /* 移动端标题优化 */
    .header-container {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .app-title {
        gap: 10px;
    }
    
    .app-icon {
        width: 28px;
        height: 28px;
    }
    
    .app-name {
        font-size: 20px;
    }
}
.upload-section {
    border: 2px dashed #a0a0a0;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all .3s ease;
    background-color: #fdfdfd;
    font-size: 18px;
    color: #606266;
    margin-bottom: 30px;
}
.upload-section:hover {
    border-color: #409EFF;
    background-color: #f0f8ff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.upload-section em {
    color: #409EFF;
    font-style: normal;
}
.main-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin-top: 30px;
}
.crop-section, .preview-section, .controls-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    box-sizing: border-box;
}
.crop-container {
    width: 500px;
    height: 500px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}
.crop-container img {
    max-width: 100%;
    display: block;
}
.cropper-point {
    width: 16px !important;
    height: 16px !important;
    background: #409EFF !important;
    border: 2px solid #ffffff !important;
    border-radius: 4px !important;
    box-shadow: 0 0 4px rgba(64, 158, 255, 0.4);
}
.cropper-point.point-se,
.cropper-point.point-sw,
.cropper-point.point-ne,
.cropper-point.point-nw {
    width: 20px !important;
    height: 20px !important;
}
.cropper-line {
    background-color: rgba(64, 158, 255, 0.9) !important;
    width: 3px !important;
}
.footer-contact {
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    color: #606266;
    padding: 16px 0 0;
    border-top: 1px solid #ebeef5;
}
.footer-contact .contact-email {
    color: #409EFF;
    font-weight: 600;
}
.preview-section, .controls-section {
    width: 250px;
    padding: 20px;
}
.preview-and-controls-wrapper {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
}
.preview-title, .controls-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}
.control-subtitle {
    font-size: 0.9em;
    font-weight: 500;
    color: #606266;
    margin-top: 20px;
    margin-bottom: 8px;
}

.info-section, .use-cases, .faq-section {
    margin-top: 40px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.4em;
    font-weight: 600;
    color: #303133;
    margin-bottom: 20px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}

.info-list li {
    margin-bottom: 12px;
    color: #606266;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.use-case-item {
    padding: 20px;
    border: 1px solid #e4e7ed;
    border-radius: 10px;
    background: #fafbff;
    min-height: 160px;
}

.use-case-item h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.05em;
    color: #409EFF;
}

.use-case-item p,
.info-section p,
.faq-item p {
    color: #606266;
    line-height: 1.6;
}

.faq-item + .faq-item {
    margin-top: 20px;
    border-top: 1px solid #ebeef5;
    padding-top: 20px;
}

.faq-item h3 {
    margin: 0 0 10px;
    font-size: 1em;
    color: #303133;
}

.preview-box {
    width: 210px;
    height: 210px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #f9f9f9;
}

/* 图片信息样式 */
.image-info {
    margin-top: 15px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    color: #495057;
    font-weight: 600;
}
.orientation-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.orientation-toggle button {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    background-color: #fff;
    color: #606266;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.orientation-toggle button:hover {
    border-color: #409EFF;
    color: #409EFF;
}
.orientation-toggle button.active {
    background-color: #409EFF;
    border-color: #409EFF;
    color: #fff;
}
.orientation-icon {
    width: 24px;
    height: 24px;
}
.aspect-ratio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: flex-start;
}
.aspect-ratio-buttons button {
    box-sizing: border-box;
    min-width: 60px;
    flex: 1;
    max-width: calc(50% - 4px);
    padding: 12px 8px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    background-color: #fff;
    color: #606266;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    margin: 0;
}
.aspect-ratio-buttons button:hover {
    border-color: #409EFF;
    color: #409EFF;
}
.aspect-ratio-buttons button.active {
    background-color: #409EFF;
    border-color: #409EFF;
    color: #fff;
}
.controls-section .el-select,
.controls-section .el-button {
    max-width: 100%;
    width: 100%;
    margin-bottom: 15px;
}

/* 错误提示样式 */
.error-message {
    background-color: #fef0f0;
    border: 1px solid #fbc4c4;
    color: #f56c6c;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
    text-align: center;
    font-size: 14px;
}

/* 响应式设计优化 - 针对非洲和东南亚移动用户 */
@media (max-width: 768px) {
    #app {
        margin: 5px;
        padding: 15px;
        border-radius: 8px;
    }

    .orientation-toggle {
        margin-bottom: 10px;
    }
    
    .main-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .crop-container {
        width: 100%;
        height: 250px; /* 减小高度适应小屏幕 */
        border-radius: 4px;
    }
    
    .preview-and-controls-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .preview-section, .controls-section {
        width: 100%;
        padding: 15px;
    }
    
    .preview-box {
        width: 100%;
        height: 150px; /* 减小预览区域 */
    }
    
    .aspect-ratio-buttons button {
        max-width: calc(50% - 4px); /* 2列布局，按钮更大 */
        padding: 12px 8px;
        font-size: 14px;
        min-height: 44px; /* 增加触摸目标大小 */
    }
    
    /* 优化上传区域 */
    .upload-section {
        padding: 30px 20px;
        font-size: 16px;
    }
    
    /* 优化按钮大小 */
    .controls-section .el-button {
        min-height: 44px;
        font-size: 16px;
    }

    .info-section, .use-cases, .faq-section {
        padding: 20px;
        border-radius: 10px;
        margin-top: 30px;
    }

    .use-case-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.2em;
    }
}

/* 超小屏幕优化（老式手机） */
@media (max-width: 480px) {
    #app {
        margin: 2px;
        padding: 10px;
    }
    
    .crop-container {
        height: 200px;
    }
    
    .preview-box {
        height: 120px;
    }
    
    .aspect-ratio-buttons button {
        font-size: 12px;
        padding: 10px 6px;
    }

    .info-section, .use-cases, .faq-section {
        padding: 16px;
        margin-top: 24px;
    }

    .section-title {
        font-size: 1.05em;
    }
}
