:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f093fb;
    --success-color: #4facfe;
    --text-color: #374151;
    --light-text: #6b7280;
    --card-bg: #ffffff;
    --border-radius: 20px;
    --border-radius-small: 12px;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --box-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    --gradient-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-card: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-feature1: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-feature2: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-feature3: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ebff 50%, #f0f2ff 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem 2rem;
}

header {
    margin-bottom: 2rem;
    padding-top: 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

/* 登录按钮 */
.login-register-btn {
    position: absolute;
    top: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: transparent;
    color: var(--primary-color);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.login-register-btn:hover {
    color: var(--secondary-color);
    transform: scale(1.05);
}

.login-register-btn:active {
    transform: scale(0.95);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0rem;
}

.logo {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 8px rgba(0, 212, 170, 0.3));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.title-section {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.title-section h1 {
    color: var(--primary-color);
    margin: 0;
    margin-left: -0.8rem;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    height: 60px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.title-section h1:hover {
    color: var(--secondary-color);
    transform: scale(1.02);
}

.website-url {
    color: var(--text-color);
    font-size: 1rem;
    margin: 0.2rem 0 0 0;
    font-weight: 500;
    text-align: left;
}

.brand {
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.2rem 0 0 0;
    opacity: 0.9;
}

.subtitle {
    color: var(--text-color);
    font-size: 1.8rem;
    margin: 0;
    text-align: center;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 900;
}

/* 当功能页面显示时隐藏Slogan */
.container:has(.image-preview-container:not([style*="display: none"])) header .subtitle,
.container:has(.multi-preview-container:not([style*="display: none"])) header .subtitle,
.container:has(.watermark-container:not([style*="display: none"])) header .subtitle,
.container:has(.idphoto-container:not([style*="display: none"])) header .subtitle,
.container:has(.splitmerge-container:not([style*="display: none"])) header .subtitle,
.container:has(.converter-container:not([style*="display: none"])) header .subtitle,
.container:has(.imagetodoc-container:not([style*="display: none"])) header .subtitle {
    display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .logo-section {
        flex-direction: column;
        gap: 0.5rem;
    }

    .title-section {
        text-align: center;
    }

    .title-section h1 {
        font-size: 1.8rem;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .login-register-btn {
        position: static;
        margin: 1rem auto 0;
        width: fit-content;
    }
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

header p {
    color: var(--light-text);
    font-size: 1.2rem;
    font-weight: 400;
}

/* 功能选择器样式 */
.function-selector {
    margin-bottom: 3rem;
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.function-card {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    overflow: hidden;
}

.function-card::after {
    content: '';
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
}

.function-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.function-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color);
}

.function-card:hover::before {
    opacity: 1;
}

.function-card.active {
    border-color: var(--primary-color);
}

.function-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.function-card h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.function-card p {
    color: var(--light-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.function-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    z-index: 2;
}

.function-status:not(.coming-soon) {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.function-status.coming-soon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .function-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 400px;
    }
    
    .function-card {
        padding: 1.5rem 1rem;
    }
    
    .function-icon {
        width: 60px;
        height: 60px;
    }
    
    .function-card h3 {
        font-size: 1.1rem;
    }
}

.upload-area {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4rem;
    box-shadow: var(--box-shadow);
    border: none;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
    border: 2px dashed #c7d2fe;
    border-radius: 16px;
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.upload-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.upload-area:hover::after, .upload-area.dragover::after {
    opacity: 1;
}

.upload-area:hover::before, .upload-area.dragover::before {
    border-color: var(--primary-color);
}

.upload-area:hover, .upload-area.dragover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.upload-area > * {
    position: relative;
    z-index: 2;
}

.upload-icon {
    margin-bottom: 1.5rem;
}

.upload-icon svg {
    fill: var(--primary-color);
    filter: drop-shadow(0 4px 6px rgba(102, 126, 234, 0.3));
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--light-text);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.file-types {
    font-size: 0.9rem;
    color: var(--light-text);
    opacity: 0.8;
}

.upload-button {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.3s ease;
}

.upload-button:hover {
    text-decoration-color: var(--primary-color);
}

/* 功能特点区域 */
.features-section {
    margin-top: 4rem;
    text-align: center;
}

.features-section h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-feature1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:nth-child(2)::before {
    background: var(--gradient-feature2);
}

.feature-card:nth-child(3)::before {
    background: var(--gradient-feature3);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-hover);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-icon.speed {
    background: var(--gradient-feature1);
}

.feature-icon.security {
    background: var(--gradient-feature2);
}

.feature-icon.custom {
    background: var(--gradient-feature3);
}

.feature-icon svg {
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--light-text);
    font-size: 1rem;
    line-height: 1.6;
}

/* 图片变换控制按钮 */
.image-transform-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.transform-button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
    min-width: 80px;
}

.transform-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 182, 212, 0.4);
}

.transform-button:active {
    transform: translateY(0);
}

.transform-button:first-child {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.3);
}

.transform-button:first-child:hover {
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.4);
}

.image-preview-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.image-preview-container:hover {
    box-shadow: var(--box-shadow-hover);
}

.image-preview {
    padding: 2rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.preview-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.reset-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(238, 90, 82, 0.3);
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(238, 90, 82, 0.4);
}

.preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.original-image, .compressed-image {
    flex: 1;
    min-width: 300px;
}

.original-image h4, .compressed-image h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.image-container {
    border: none;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-info {
    font-size: 0.9rem;
    color: var(--light-text);
}

/* 信息分隔符样式 */
.info-separator {
    color: #8b5cf6;
    font-weight: bold;
    margin: 0 8px;
    text-shadow: 0 0 3px rgba(139, 92, 246, 0.3);
}

/* 压缩率百分比样式 */
.compression-ratio {
    color: #10b981;
    font-weight: bold;
}

/* 裁剪相关样式 */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 10;
    cursor: crosshair;
}

.crop-box {
    position: absolute;
    border: 2px dashed white;
    background-color: transparent;
    cursor: move;
    z-index: 11;
    /* 使用box-shadow创建外部遮罩，内部保持透明 */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    transform-origin: center center;
}

/* 旋转手柄 */
.rotate-handle {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #4CAF50;
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rotate-handle:hover {
    background: #4CAF50;
    transform: scale(1.1);
}

.rotate-handle:active {
    cursor: grabbing;
}

.rotate-handle svg {
    color: #4CAF50;
    transition: color 0.2s ease;
}

.rotate-handle:hover svg {
    color: white;
}

/* 裁剪框尺寸显示 */
.crop-size-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 12;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.crop-size-edit-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    padding: 0;
}

.crop-size-edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.crop-size-edit-btn svg {
    display: block;
}

/* 裁剪尺寸输入对话框 */
.crop-size-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.crop-size-modal.show {
    display: flex;
}

.crop-size-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90%;
    animation: modalSlideIn 0.3s ease-out;
    overflow: visible;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crop-size-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.crop-size-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.crop-size-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.crop-size-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.crop-size-modal-body {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: visible;
}

.crop-size-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crop-size-input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.crop-size-input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.crop-size-input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 强制显示并放大number input的上下箭头 */
.crop-size-input-field::-webkit-outer-spin-button,
.crop-size-input-field::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button !important;
    opacity: 1 !important;
    width: 30px !important;
    height: auto !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    transform: scale(1.5) !important;
    transform-origin: center right !important;
}

/* 确保在所有状态下都显示箭头 */
.crop-size-input-field:hover::-webkit-outer-spin-button,
.crop-size-input-field:hover::-webkit-inner-spin-button,
.crop-size-input-field:focus::-webkit-outer-spin-button,
.crop-size-input-field:focus::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button !important;
    opacity: 1 !important;
}

/* Firefox浏览器支持 */
.crop-size-input-field {
    -moz-appearance: textfield;
}

.crop-size-input-field::-moz-outer-spin-button,
.crop-size-input-field::-moz-inner-spin-button {
    -moz-appearance: inner-spin-button !important;
    opacity: 1 !important;
}

.crop-size-lock-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
}

.crop-size-lock-wrapper {
    position: relative;
    display: inline-block;
}

.crop-size-lock-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.crop-size-lock-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary-color);
}

.crop-size-lock-btn.locked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 自定义tooltip样式 */
.crop-size-lock-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 10001;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.crop-size-lock-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

.crop-size-lock-wrapper:hover .crop-size-lock-tooltip {
    opacity: 1;
    visibility: visible;
}

.crop-size-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.crop-size-modal-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn {
    background: #f3f4f6;
    color: #374151;
}

.cancel-btn:hover {
    background: #e5e7eb;
}

.confirm-btn {
    background: var(--gradient-bg);
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.35);
}

.resize-handle {
    position: absolute;
    background-color: white;
    border: 2px solid #4a6cf7;
    z-index: 12;
}

/* 四个角的调整柄 */
.resize-handle.corner {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.resize-handle.corner.top-left {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.resize-handle.corner.top-right {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.resize-handle.corner.bottom-left {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.resize-handle.corner.bottom-right {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

/* 四条边中心的调整柄 */
.resize-handle.edge {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-color: #4a6cf7;
    border: 2px solid white;
}

.resize-handle.edge.top {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.resize-handle.edge.bottom {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.resize-handle.edge.left {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.resize-handle.edge.right {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.crop-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.crop-button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
}

.crop-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 182, 212, 0.4);
}

.crop-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 取消裁剪按钮 - 天蓝色 */
#cancelCropButton:not(:disabled),
[id^="multiCancelCropButton-"]:not(:disabled) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.3);
}

#cancelCropButton:hover:not(:disabled),
[id^="multiCancelCropButton-"]:hover:not(:disabled) {
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.4);
}

/* 撤销裁剪按钮(新增的撤销裁剪按钮) - 使用复原按钮的背景色 */
.undo-crop-button:not(:disabled) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.3);
}

.undo-crop-button:hover:not(:disabled) {
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.4);
}

/* 取消裁剪按钮禁用状态 */
#cancelCropButton:disabled,
[id^="multiCancelCropButton-"]:disabled {
    background: #cbd5e0 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none !important;
}

/* 比例选择器样式 */
.aspect-ratio-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
}

.aspect-ratio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.3rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    min-width: 50px;
    flex-shrink: 0;
    max-width: 70px;
}

.aspect-ratio-option:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.aspect-ratio-option.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.ratio-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.free-icon svg {
    color: #e91e63;
}

.ratio-shape {
    border: 2px solid currentColor;
    background: rgba(102, 126, 234, 0.1);
}

.square {
    width: 20px;
    height: 20px;
}

.ratio-2-3 {
    width: 16px;
    height: 24px;
}

.ratio-3-2 {
    width: 24px;
    height: 16px;
}

.ratio-3-4 {
    width: 18px;
    height: 24px;
}

.ratio-4-3 {
    width: 24px;
    height: 18px;
}

.ratio-16-9 {
    width: 28px;
    height: 16px;
}

.ratio-9-16 {
    width: 16px;
    height: 28px;
}

.ratio-9-20 {
    width: 14px;
    height: 31px;
}

.ratio-21-9 {
    width: 32px;
    height: 14px;
}

.ratio-7-5 {
    width: 24px;
    height: 17px;
}

.ratio-5-7 {
    width: 17px;
    height: 24px;
}

.ratio-5-4 {
    width: 22px;
    height: 18px;
}

.ratio-4-5 {
    width: 18px;
    height: 22px;
}

.ratio-16-10 {
    width: 27px;
    height: 17px;
}

.aspect-ratio-option span {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

.compression-controls {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: end;
}

/* 左侧控制区域 - 跨越两列,位于第一行 */
.controls-left {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.controls-left .control-group:last-child {
    margin-bottom: 0;
}

/* 开始压缩按钮 - 第二行左侧 */
.compress-button {
    grid-column: 1 / 2;
    grid-row: 2;
    margin-top: 0;
}

/* 右侧下载按钮区域 - 第二行右侧 */
.controls-right {
    grid-column: 2 / 3;
    grid-row: 2;
    display: flex;
    align-items: stretch;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-bg);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

input[type="number"], select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 尺寸输入框样式 */
.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.size-input-label {
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
    display: flex;
    align-items: center;
}

.size-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.size-input-prefix {
    font-size: 0.85rem;
    color: #718096;
    user-select: none;
    white-space: nowrap;
}

.size-input {
    width: 100px;
    height: 38px;
    padding: 0 0.5rem !important;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: left;
}

.size-input-with-prefix {
    /* 有前缀标签的输入框不需要额外样式 */
}

/* 移除 number 输入框的内边距 */
.size-input::-webkit-inner-spin-button,
.size-input::-webkit-outer-spin-button {
    margin-left: 0.3rem;
}

.size-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.size-lock-icon {
    font-size: 1.1rem;
    cursor: default;
    user-select: none;
    display: flex;
    align-items: center;
}

.compress-button, .download-button {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.compress-button {
    margin-top: 1.5rem;
}

.download-button {
    margin-top: 0;
}

.compress-button {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 8px 15px rgba(6, 182, 212, 0.3);
    border-radius: 10px;
}

.compress-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(6, 182, 212, 0.4);
}

.compress-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.6;
    position: relative;
}

.download-button {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.3);
    border-radius: 10px;
}

.download-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(79, 172, 254, 0.4);
}

.download-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 裁剪时的按钮提示 - 注释掉,使用内联样式 */

footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    color: var(--light-text);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .features-section h2 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .upload-area {
        padding: 3rem 1.5rem;
    }

    .preview-images {
        flex-direction: column;
    }

    .original-image, .compressed-image {
        width: 100%;
    }

    .image-container {
        height: 350px;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }

    /* 移动端压缩控件垂直排列 */
    .compression-controls {
        flex-direction: column;
        gap: 1.5rem;
    }

    .controls-left,
    .controls-right {
        width: 100%;
    }

    .download-button {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .image-preview {
        padding: 1.5rem;
    }
    
    .compression-controls {
        padding: 1.5rem;
    }
}

/* 多图预览容器样式 */
.multi-preview-container {
    display: none;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-top: 2rem;
    overflow: hidden;
}

.multi-image-section {
    padding: 1.5rem;
}

.multi-image-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.multi-image-section .preview-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.multi-image-section .image-container {
    position: relative;
    background: #f8f9fa;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-image-section .image-container img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: var(--border-radius-small);
}

/* 滚动到控制面板按钮 */
.scroll-to-controls-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.scroll-to-controls-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.scroll-to-controls-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.scroll-to-controls-button span {
    font-size: 1rem;
}

/* 主页脚样式 */
.main-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    margin: 0;
    padding: 0;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-section h4 {
    color: #3498db;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-links a.coming-soon-link {
    color: #95a5a6;
    cursor: not-allowed;
}

.footer-links a.coming-soon-link:hover {
    color: #95a5a6;
}

.footer-email {
    color: #3498db !important;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 品牌区域 */
.brand-section {
    grid-column: span 1;
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.footer-brand-title {
    color: #3498db;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.footer-slogan {
    color: #bdc3c7;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    align-self: flex-start;
}

/* 页脚底部 */
.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: #95a5a6;
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .brand-section {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .multi-image-section .preview-images {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .scroll-to-controls-button {
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
        gap: 0.4rem;
    }
    
    .scroll-to-controls-button span {
        font-size: 0.9rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        padding: 2rem 1rem 1.5rem;
        gap: 1.5rem;
    }
    
    .brand-section {
        grid-column: span 1;
    }
    
    .footer-logo {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-bottom-content {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 1.5rem 1rem 1rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .footer-links a {
        font-size: 0.85rem;
    }
    
    .footer-slogan {
        font-size: 0.85rem;
    }
}

/* ===== 水印功能样式 ===== */

/* 水印容器 */
.watermark-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.watermark-container:hover {
    box-shadow: var(--box-shadow-hover);
}

.watermark-preview {
    padding: 2rem;
}

.watermark-tip-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: default;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    pointer-events: none;
    opacity: 0.9;
}

.watermark-tip-button span {
    font-size: 1rem;
}

.watermark-content {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
    min-height: 600px;
}

/* 水印图片区域 */
.watermark-image-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.watermark-image-container {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.watermark-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: default;
}

.watermark-drag-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.watermark-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    pointer-events: auto;
    border: 2px dashed rgba(99, 102, 241, 0.5);
    padding: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.watermark-element:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    cursor: grab;
}

.watermark-element:active {
    cursor: grabbing;
}

.watermark-image-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--light-text);
    text-align: center;
}

/* 水印控制面板 */
.watermark-controls {
    width: 320px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    padding: 1.5rem;
    height: fit-content;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

/* 水印标签页 */
.watermark-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.watermark-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--light-text);
    transition: all 0.3s ease;
    position: relative;
}

.watermark-tab.active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.watermark-tab:not(.active):hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* 水印面板 */
.watermark-panel {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.85rem;
}

/* 输入控件 */
.watermark-input, .watermark-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-small);
    font-size: 0.85rem;
    background: white;
    transition: all 0.3s ease;
}

.watermark-input:focus, .watermark-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 字体控件 */
.font-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.font-style-controls {
    display: flex;
    gap: 0.25rem;
}

.font-style-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-style-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.font-style-btn.active {
    background: var(--gradient-bg);
    color: white;
    border-color: var(--primary-color);
}

#fontBold {
    font-family: Arial, sans-serif;
}

#fontItalic {
    font-style: italic;
    font-family: Georgia, serif;
}

/* 颜色选择器 */
.color-palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-option.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* 白色选项特殊处理 */
.color-option[data-color="#FFFFFF"] {
    border: 2px solid #e2e8f0;
}

.color-option[data-color="#FFFFFF"].active {
    border: 3px solid var(--primary-color);
}

/* 滑块控件 */
.watermark-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    margin-top: 0.5rem;
}

.watermark-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-bg);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.watermark-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

.watermark-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-bg);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
    border: none;
}

/* 复选框 */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--gradient-bg);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 按钮样式 */
.upload-watermark-btn {
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.upload-watermark-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.download-watermark-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.3);
}

.download-watermark-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(79, 172, 254, 0.4);
}

.download-watermark-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 水印图片预览 */
.watermark-image-preview {
    position: relative;
    margin-top: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    background: white;
}

.watermark-image-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.remove-watermark-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-watermark-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* 多图水印容器 */
.watermark-multi-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    height: 100%;
    overflow-y: auto;
}

/* 水印图片区域高度调整 */
.watermark-image-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.watermark-multi-item {
    position: relative;
    margin-bottom: 1rem;
}

.watermark-multi-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.watermark-multi-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.watermark-multi-item-info {
    font-size: 0.85rem;
    color: var(--light-text);
}

.watermark-multi-image-container {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.watermark-multi-canvas {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    cursor: default;
}

.watermark-multi-drag-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.watermark-multi-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    pointer-events: auto;
    border: 2px dashed rgba(99, 102, 241, 0.5);
    padding: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.watermark-multi-element:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    cursor: grab;
}

.watermark-multi-element:active {
    cursor: grabbing;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .watermark-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .watermark-controls {
        width: 100%;
    }

    .watermark-image-container {
        min-height: 300px;
    }

    .watermark-multi-container {
        max-height: 400px;
    }

    .watermark-multi-image-container {
        min-height: 250px;
    }

    .color-palette {
        grid-template-columns: repeat(4, 1fr);
    }

    .watermark-preview {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .watermark-preview {
        padding: 1rem;
    }

    .watermark-image-container {
        min-height: 250px;
    }

    .color-palette {
        grid-template-columns: repeat(3, 1fr);
    }

    .font-controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
}

/* ==================== 证件照制作样式 ==================== */
.idphoto-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.idphoto-container:hover {
    box-shadow: var(--box-shadow-hover);
}

.idphoto-preview {
    padding: 2rem;
}

.idphoto-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.idphoto-image-section {
    display: flex;
    flex-direction: column;
}

.idphoto-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.original-idphoto,
.preview-idphoto {
    text-align: center;
}

.original-idphoto h4,
.preview-idphoto h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.idphoto-container-inner {
    position: relative;
    display: inline-block;
    border: 2px solid #e5e7eb;
    border-radius: 0; /* 移除圆角，避免裁剪 */
    overflow: visible; /* 允许裁剪框超出边界显示 */
}

.idphoto-canvas {
    display: block;
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    /* 确保保持原始比例，不会被拉伸 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: smooth;
}

.idphoto-preview-container {
    /* 移除边框和背景，只保留内容居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    /* 为卡片效果增加额外的间距 */
    padding: 20px;
    background: transparent;
}

.idphoto-preview-canvas {
    display: block;
    /* 保持原始比例，避免CSS强制拉伸 */
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: smooth;
    /* 移除可能导致拉伸的尺寸限制 */

    /* 添加照片卡片效果 - 白色边框和浮动阴影 */
    border: 5px solid #ffffff;
    border-radius: 4px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 6px 20px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    transition: all 0.3s ease;

    /* 确保四周边框完全一致 */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

/* 鼠标悬停时增强浮动效果 */
.idphoto-preview-canvas:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 3px 6px rgba(0, 0, 0, 0.08);
}

/* 8张照片排布图样式 */
.idphoto-layout-preview {
    margin-top: 20px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.layout-row {
    display: flex;
    gap: 0px;
    margin-bottom: 0px;
}

.layout-row:last-child {
    margin-bottom: 0;
}

.layout-photo {
    width: 40px;
    height: 56px;
    background: #4A90E2;
    border: 2px solid #ffffff;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.layout-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 裁剪框样式 */
.idphoto-crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* overlay本身不接收事件 */
    overflow: visible; /* 允许子元素超出 */
}

.idphoto-crop-box {
    position: absolute;
    border: 2px dashed var(--primary-color);
    background: transparent;
    cursor: move;
    min-width: 50px;
    min-height: 50px;
    pointer-events: auto; /* 裁剪框接收事件 */
    z-index: 2; /* 在遮罩层之上 */
}

.idphoto-crop-box .resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    z-index: 10;
}

.idphoto-crop-box .resize-handle.top-left {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.idphoto-crop-box .resize-handle.top-right {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.idphoto-crop-box .resize-handle.bottom-left {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.idphoto-crop-box .resize-handle.bottom-right {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

/* 控制面板样式 */
.idphoto-controls {
    background: #f8f9fa;
    border-radius: var(--border-radius-small);
    padding: 1.5rem;
    height: fit-content;
}

.idphoto-controls .control-group {
    margin-bottom: 1.5rem;
}

.idphoto-controls .control-group:last-child {
    margin-bottom: 0;
}

.idphoto-controls label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* 尺寸分类选择器 */
.size-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.size-category {
    flex: 1;
    min-width: 0;
}

.category-btn {
    width: 100%;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-category.active .category-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.category-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.size-category.active .category-btn:hover {
    background: var(--primary-color);
}

/* 各国签证二级分类 */
.visa-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.03);
    border-radius: 8px;
}

.visa-subcategory {
    flex: 1;
    min-width: 0;
}

.subcategory-btn {
    width: 100%;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.visa-subcategory.active .subcategory-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.subcategory-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.visa-subcategory.active .subcategory-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 尺寸选项 */
.size-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    background: white;
}

.size-option {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.85rem;
    background: white;
}

.size-option:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.size-option.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.size-option .size-name {
    font-weight: 600;
    display: block;
}

.size-option .size-dimensions {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

/* 背景颜色选择器 */
.background-colors {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.bg-color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.bg-color-option:hover {
    transform: scale(1.1);
}

.bg-color-option.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.bg-color-option::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bg-color-option.active::after {
    opacity: 1;
}

/* 复选框样式 */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 格式选择器 */
.format-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 动作按钮 */
.idphoto-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.idphoto-btn {
    width: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.3);
}

.idphoto-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.4);
}

.idphoto-btn:active {
    transform: translateY(0);
}

.idphoto-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 图片信息 */
.idphoto-image-info,
.idphoto-preview-info {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--light-text);
    /* 与左侧原图的文字说明框对齐 */
    margin-bottom: 0;
}

/* 预览区域的输出控制 */
.idphoto-output-controls {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.idphoto-output-controls .control-group {
    width: 100%;
    margin-bottom: 0;
}

.idphoto-output-controls .control-group label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.idphoto-output-controls .format-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.idphoto-output-controls .format-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.idphoto-output-controls .idphoto-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0;
}

.idphoto-output-controls .idphoto-actions .idphoto-btn {
    width: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.3);
}

.idphoto-output-controls .idphoto-actions .idphoto-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.4);
}

.idphoto-output-controls .idphoto-actions .idphoto-btn:active {
    transform: translateY(0);
}

.idphoto-output-controls .idphoto-actions .idphoto-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 自定义尺寸输入 */
.custom-size-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.custom-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
}

.custom-input-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: left;
    margin: 0;
    align-self: flex-start;
    padding-left: 0.3rem;
}

.custom-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: flex-start;
}

.custom-size-input {
    padding: 0.4rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: var(--text-color);
    font-size: 0.95rem;
    text-align: center;
    min-width: 100px;
    width: 120px;
    max-width: 150px;
}

/* 强制显示number input的spin buttons并放大 */
.custom-size-input::-webkit-outer-spin-button,
.custom-size-input::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button !important;
    opacity: 1 !important;
    width: 30px !important;
    height: auto !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    transform: scale(1.8) !important;
    transform-origin: center right !important;
}

/* 确保在所有状态下都显示箭头 */
.custom-size-input:hover::-webkit-outer-spin-button,
.custom-size-input:hover::-webkit-inner-spin-button,
.custom-size-input:focus::-webkit-outer-spin-button,
.custom-size-input:focus::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button !important;
    opacity: 1 !important;
}

/* Firefox浏览器支持 */
.custom-size-input {
    -moz-appearance: textfield;
}

.custom-size-input::-moz-outer-spin-button,
.custom-size-input::-moz-inner-spin-button {
    -moz-appearance: inner-spin-button !important;
    opacity: 1 !important;
}

.custom-size-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.custom-input-unit {
    font-size: 0.85rem;
    color: var(--light-text);
    white-space: nowrap;
}


/* 响应式设计 */
@media (max-width: 1024px) {
    .idphoto-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .idphoto-images {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .idphoto-controls {
        order: -1;
    }
}

@media (max-width: 768px) {
    .idphoto-container {
        padding: 1rem;
    }

    .idphoto-preview {
        padding: 1.5rem;
    }

    .size-categories {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .size-options {
        grid-template-columns: 1fr;
    }

    .background-colors {
        justify-content: center;
    }

    .custom-size-inputs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .idphoto-preview {
        padding: 1rem;
    }

    .idphoto-canvas,
    .idphoto-preview-canvas {
        max-height: 250px;
    }

    .size-categories {
        grid-template-columns: 1fr;
    }

    .category-btn {
        padding: 0.75rem;
    }
}

/* AI处理加载弹窗样式 */
.ai-processing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.ai-processing-modal.show {
    display: flex;
}

.ai-processing-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ai-processing-image-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: #f0f0f0;
}

.ai-processing-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 扫描线动画 */
.ai-scanning-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(102, 126, 234, 0.3) 25%,
        rgba(102, 126, 234, 0.8) 50%,
        rgba(102, 126, 234, 0.3) 75%,
        transparent 100%
    );
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8),
                0 0 40px rgba(102, 126, 234, 0.5);
    animation: scanning 2s linear infinite;
}

@keyframes scanning {
    0% {
        top: 0;
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        top: 100%;
        opacity: 1;
    }
}

.ai-processing-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ai-processing-content {
        padding: 2rem;
        margin: 1rem;
    }

    .ai-processing-image-wrapper {
        width: 250px;
        height: 250px;
    }

    .ai-processing-text {
        font-size: 1rem;
    }
}

/* ==================== 图片分割拼接样式 ==================== */
.splitmerge-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.splitmerge-container:hover {
    box-shadow: var(--box-shadow-hover);
}

.splitmerge-preview {
    padding: 2rem;
}

.splitmerge-content {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
    min-height: 600px;
}

.splitmerge-image-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.split-preview, .merge-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    padding: 1rem;
}

.split-preview {
    justify-content: center;
}

.split-canvas, .merge-canvas {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 0;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    display: block;
}

.split-canvas:hover, .merge-canvas:hover {
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-2px);
}

/* 拼接模版选择区域 */
.merge-templates-section {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius-small);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.templates-header {
    margin-bottom: 1rem;
}

.templates-header label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* 控制面板 */
.splitmerge-controls {
    width: 320px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    padding: 1rem 1.2rem;
    font-size: 13px;
    line-height: 1.4;
}

.splitmerge-controls .control-group {
    margin-bottom: 1rem;
}

.splitmerge-controls .control-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 13px;
}

.splitmerge-controls .btn,
.splitmerge-controls button {
    padding: 0.4rem 0.8rem;
    font-size: 12px;
}

.splitmerge-controls input[type="number"],
.splitmerge-controls input[type="range"] {
    font-size: 12px;
}

.splitmerge-controls .ratio-btn {
    padding: 0.4rem 0.6rem;
    font-size: 12px;
}

/* 模式切换标签 */
.mode-tabs {
    display: flex;
    margin-bottom: 1rem;
    background: white;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-tab {
    flex: 1;
    padding: 0.75rem 1rem !important;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600 !important;
    font-size: 15px !important;
    color: var(--light-text);
    transition: all 0.3s ease;
}

.mode-tab.active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.mode-tab:not(.active):hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* 控制面板 */
.control-panel {
    animation: fadeIn 0.3s ease;
}

.control-panel .control-group {
    margin-bottom: 1.5rem;
}

.control-panel .control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

/* 数字输入框 */
.number-input, .size-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.number-input:focus, .size-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 数字输入框上下箭头始终显示并放大 */
.number-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button {
    opacity: 1;
    width: 20px;
    height: 30px;
    cursor: pointer;
}

.size-input::-webkit-inner-spin-button,
.size-input::-webkit-outer-spin-button {
    opacity: 1;
    width: 20px;
    height: 30px;
    cursor: pointer;
}

/* 尺寸输入组 */
.size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-inputs .size-input {
    flex: 1;
}

.size-inputs span {
    color: var(--text-color);
    font-weight: 600;
}

/* 预设比例按钮 */
.preset-ratios {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ratio-btn {
    flex: 1;
    min-width: 60px;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ratio-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.ratio-btn:not(.active):hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

/* 滑块 */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    margin-top: 0.5rem;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-bg);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

/* 图片操作按钮 */
.image-operations {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.operation-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.3);
}

.operation-btn .btn-line1,
.operation-btn .btn-line2 {
    display: block;
    line-height: 1;
}

.operation-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 182, 212, 0.4);
}

.operation-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* 复原按钮 - 天蓝色渐变 */
#resetImage {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.3);
}

#resetImage:hover:not(:disabled) {
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.4);
}

.operation-btn.delete-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 4px 6px rgba(255, 107, 107, 0.3);
}

.operation-btn.delete-btn:hover:not(:disabled) {
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

/* 下载按钮 */
.download-btn {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    border: none !important;
    border-radius: 10px !important;
    background: var(--gradient-feature1) !important;
    color: white !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 1rem !important;
    box-shadow: 0 4px 6px rgba(79, 172, 254, 0.3) !important;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(79, 172, 254, 0.4);
}

/* 数量标签 */
.count-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.count-tab {
    flex: 0 0 auto;
    min-width: 35px;
    padding: 0.4rem 0.6rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.count-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.count-tab:not(.active):hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

/* 模版网格 */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.template-item {
    aspect-ratio: 1;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    padding: 4px;
}

.template-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.template-item:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.template-item svg {
    width: 100%;
    height: 100%;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .splitmerge-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .splitmerge-controls {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .splitmerge-container {
        padding: 1rem;
    }

    .splitmerge-preview {
        padding: 1.5rem;
    }

    .preset-ratios {
        grid-template-columns: repeat(3, 1fr);
    }

    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .splitmerge-preview {
        padding: 1rem;
    }

    .image-operations {
        flex-direction: column;
    }

    .operation-btn {
        width: 100%;
    }
}

/* 画布背景相关样式 */
.bg-tab-btn {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.bg-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.bg-tab-btn:hover:not(.active) {
    background: #f3f4f6;
}

.bg-panel {
    padding: 0.5rem 0;
}

.preset-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* 背景浮动按钮 */
.bg-float-btn {
    position: relative;
    margin-top: 10px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    background: white;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.bg-float-btn-small {
    margin-top: 0;
    padding: 0.35rem 0.75rem;
    font-size: 11px;
    width: auto;
}

.bg-float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bg-float-btn:active {
    transform: translateY(0);
}

.bg-float-btn-primary {
    background: var(--gradient-bg);
    color: white;
}

.bg-float-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ==================== 图片预览模态框样式 ==================== */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.image-preview-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    /* 添加立体阴影效果,确保在白色背景上也清晰可见 */
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    /* 添加文字阴影,确保X符号在白色背景上也能看清 */
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(0, 0, 0, 0.4);
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
}

.image-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.image-preview-wrapper.dragging {
    cursor: grabbing;
}

.preview-modal-image {
    max-width: none;
    max-height: none;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

.image-preview-zoom-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 鼠标悬停时的手型光标 */
.image-container img.preview-enabled {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.image-container img.preview-enabled:hover {
    transform: scale(1.02);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .image-preview-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .image-preview-zoom-info {
        bottom: 20px;
        padding: 6px 16px;
        font-size: 12px;
    }
}
/* ==================== 错误弹窗样式 ==================== */
.error-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.error-dialog-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: errorDialogFadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@keyframes errorDialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.error-dialog-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: errorIconPulse 0.5s ease;
}

@keyframes errorIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.error-dialog-icon svg {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.error-dialog-message {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 2rem;
    word-break: break-word;
}

.error-dialog-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.error-dialog-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.error-dialog-btn:active {
    transform: translateY(0);
}

/* ==================== 关于我们页面样式 ==================== */
.about-us-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.about-us-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.about-us-header h2 {
    font-size: 2rem;
    font-weight: 900;
    color: #000;
    margin: 0;
}

.back-home-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(238, 90, 82, 0.3);
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(238, 90, 82, 0.4);
}

.about-us-content {
    line-height: 1.8;
    color: #333;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.about-section p {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.about-intro {
    font-size: 1.15rem;
    line-height: 2;
}

.about-intro a {
    color: #6366f1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.about-intro a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

.about-footer {
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.about-footer p {
    font-size: 1rem;
    color: #666;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .about-us-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .about-us-header h2 {
        font-size: 1.5rem;
    }

    .about-us-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .about-section h3 {
        font-size: 1.25rem;
    }

    .about-section p {
        font-size: 1rem;
    }

    .about-intro {
        font-size: 1.05rem;
    }

    .about-us-btn {
        font-size: 14px;
        padding: 0.5rem 1rem;
        margin-left: 0.5rem;
    }
}
