.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #00dbde, #fc00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    font-size: 1.2rem;
    color: #aaa;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.tool-content {
    margin-top: 2rem;
}

.upload-section {
    text-align: center;
    padding: 2rem;
    background: var(--feature-card-bg);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed var(--input-border);
    border-radius: 10px;
    padding: 3rem;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #00dbde;
    background: var(--feature-card-hover-bg);
}

.upload-area p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.editor-section {
    background: var(--feature-card-bg);
    border-radius: 10px;
    padding: 2rem;
}

.editor-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.preview-container {
    flex: 1;
    min-width: 300px;
}

.image-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    border-radius: 5px;
    padding: 1rem;
    min-height: 300px;
    transition: background-color 0.3s ease;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    display: none;
}

.controls {
    flex: 1;
    min-width: 300px;
}

.control-group {
    margin-bottom: 2rem;
}

.control-group h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-option:hover,
.color-option.active {
    transform: scale(1.1);
    border-color: #00dbde;
}

.size-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-option {
    padding: 10px 15px;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-option:hover,
.size-option.active {
    background: #00dbde;
}

.custom-size {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-size label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

.custom-size input {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--input-text);
    width: 80px;
}

.download-section {
    text-align: center;
}

@media (max-width: 768px) {
    .editor-content {
        flex-direction: column;
    }
    
    .tool-container {
        padding: 10px;
    }
}

/* 添加到CSS文件中 */


.picked-color-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background-color: var(--feature-card-bg);
    border-radius: 5px;
}

.picked-color-preview {
    width: 30px;
    height: 30px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
}

#pickColorButton.active {
    background-color: #007bff;
    color: white;
}

/* 添加到CSS文件中 */
.auto-detected-color {
    padding: 10px;
    background-color: var(--feature-card-bg);
    border-radius: 5px;
    margin-bottom: 15px;
}

.color-preview-box {
    width: 30px;
    height: 30px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
}
/* 添加到CSS文件中 */
.manual-input-wrapper {
    margin-top: 15px;
    padding: 15px;
    background-color: var(--feature-card-bg);
    border-radius: 8px;
    border: 1px solid var(--input-border);
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
}

.color-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.manual-color-preview {
    width: 30px;
    height: 30px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    margin-top: 10px;
}

.btn.secondary {
    padding: 10px 15px;
    background-color: var(--secondary-btn-bg);
    color: var(--secondary-btn-text);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn.secondary:hover {
    background-color: var(--secondary-btn-hover-bg);
}

.btn.primary {
    padding: 10px 15px;
    background-color: var(--primary-btn-bg);
    color: var(--primary-btn-text);
    border: 1px solid var(--primary-btn-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn.primary:hover {
    background-color: var(--primary-btn-hover-bg);
}
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* 添加到CSS文件中 */
/* 最终解决方案 */
.detection-and-picking {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.auto-detected-color,
.manual-color-picker {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    background-color: var(--feature-card-bg);
    border-radius: 8px;
    border: 1px solid var(--input-border);
    box-sizing: border-box;
    align-self: flex-start; /* 确保从顶部对齐 */
}

/* 强制两个元素从同一水平线开始 */
.detection-and-picking > div {
    vertical-align: top;
}

/* 在小屏幕上堆叠显示 */
@media (max-width: 768px) {
    .detection-and-picking {
        flex-direction: column;
    }
    
    .auto-detected-color,
    .manual-color-picker {
        min-width: 100%;
    }
}