:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #06d6a0;
    --dark: #1e1e2d;
    --light: #f8f9fa;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #1a2a6c, #571a1a, #1a2a6c);
    background-size: 400% 400%;
    animation: gradientBG 60s ease infinite;
    color: var(--light);
    line-height: 1.6;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    display: flex;
    gap: 25px;
    width: 100%;height:95vh;
    max-width: 1600px;
}

/* 玻璃态卡片样式 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* 控制面板 */
.controls-panel {
    flex: 0 0 380px;
    display: flex;
    flex-direction: column;
    padding: 25px;
    gap: 25px;overflow-y: scroll; scrollbar-width: none;   
  -ms-overflow-style: none;
}
.controls-panel::-webkit-scrollbar {
  display: none; /* 直接不显示滚动条 */
}
.app-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary);
    background: rgba(67, 97, 238, 0.15);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.version-badge {
    background: var(--success);
    color: var(--dark);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: auto;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 15px;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.upload-area:hover::before {
    opacity: 1;
    transform: rotate(15deg);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.upload-area p {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 10px;
}

/* 设置卡片 */
.settings-card {
    padding: 20px;
    border-radius: 14px;
    background: rgba(30, 30, 45, 0.4);
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header i {
    font-size: 20px;
    color: var(--primary);
}

.settings-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* 表单控件 */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form-group label i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.value-badge {
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    padding: 12px 15px;
    padding-right: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(0, 0, 0, 0.25);
    color: white;
    font-size: 15px;
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

.select-wrapper i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.5);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    outline: none;
    appearance: none;
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(67, 97, 238, 0.5);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(67, 97, 238, 0.8);
}

.slider-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    line-height: 1.4;
}

/* 状态卡片 */
.status-card {
    margin-top: auto;
    background: rgba(30, 30, 45, 0.4);
    border-radius: 14px;
    padding: 20px;
}

#status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 15px;
    min-height: 52px;
    margin-bottom: 20px;
    line-height: 1.5;
}

#status i {
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

button {
    padding: 14px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(114, 9, 183, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(114, 9, 183, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-btn {
    background: linear-gradient(135deg, var(--success), #06b6d4);
    box-shadow: 0 4px 15px rgba(6, 214, 160, 0.3);
}

.download-btn:hover {
    box-shadow: 0 6px 20px rgba(6, 214, 160, 0.4);
}

/* 显示面板 */
.display-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 0;
    height: 100%;
}

.image-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.image-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

.image-container {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#originalImage, #canvasContainer canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    background: 
        linear-gradient(45deg, #222 25%, transparent 25%, transparent 75%, #222 75%),
        linear-gradient(45deg, #222 25%, #333 25%, #333 75%, #222 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

#canvasZoomContainer {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.15);
}

#canvasContainer canvas {
    transform-origin: top left;
    transition: transform 0.2s ease-out;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
        height: auto;
    }
    
    .controls-panel {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .display-panel {
        flex: 1;
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .app-container {
        gap: 15px;
    }
    
    .controls-panel, .image-card {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .image-info {
        align-self: flex-start;
    }
}
