
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #6b6b6b;
    color: #e0e0e0;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-y: auto;
}

.container {
    background-color: #272727;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 15px;
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease;
}

h1 {
    text-align: center;
    margin-bottom: 3px;
    font-size: 18px;
    color: #e0e0e0; 
}


.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.github-link {
    text-align: right;
    margin-top: 15px;
    font-size: 12px;
    color: #b0b0b0;
}

.github-link a {
    color: #64B5F6;
    text-decoration: none;
}

.github-link a:hover {
    text-decoration: underline;
}


.palette-selector {
    position: relative;
    display: inline-block;
    margin-bottom: 5px;
}

.palette-btn {
    background-color: #2196F3; 
    color: white;
    border: none;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.palette-btn:hover {
    background-color: #1976D2;
}

.palette-btn::after {
    content: '▼';
    font-size: 8px;
}

.palette-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #2c2c2c; 
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 160px; /* 从180px减小到160px */
    z-index: 100;
    display: none;
    margin-top: 3px; /* 从5px减小到3px */
    overflow: hidden;
    border: 1px solid #3c3c3c; 
    font-size: 12px; /* 添加整体字体大小 */
}

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

.palette-option {
    padding: 6px 10px; /* 从10px 12px减小到6px 10px */
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px; /* 从13px减小到12px */
    color: #e0e0e0; 
}

.palette-option:hover {
    background-color: #3c3c3c; 
}

.palette-option.active {
    background-color: #2196F3; 
    color: white;
}


.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.palette-info {
    margin-bottom: 10px;
    font-size: 14px;
    color: #b0b0b0;
}

/* 语言切换按钮 */
.lang-selector {
    position: absolute;
    top: 0;
    left: 0;
}

.lang-btn {
    background-color: #404040;
    color: #b0b0b0;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
}

.lang-btn:hover {
    background-color: #505050;
    opacity: 1;
}

/* 缩放选择器样式 */
.zoom-selector {
    position: absolute;
    top: 0;
    right: 0;
}

.zoom-btn {
    background-color: #404040;
    color: #b0b0b0;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
}

.zoom-btn:hover {
    background-color: #505050;
    opacity: 1;
}

.zoom-btn::after {
    content: '▼';
    font-size: 8px;
}

.zoom-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2c2c2c;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 80px;
    z-index: 1000;
    display: none;
    margin-top: 3px;
    overflow: hidden;
    border: 1px solid #3c3c3c;
}

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

.zoom-option {
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
    color: #e0e0e0;
    text-align: center;
}

.zoom-option:hover {
    background-color: #3c3c3c;
}

.zoom-option.active {
    background-color: #505050;
    color: #ffffff;
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
    gap: 2px;
    margin-bottom: 15px;
    padding: 5px;
    border-radius: 8px;
    background-color: #2c2c2c; 
}

.color-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    border: 2px solid #ffffff; 
    transition: transform 0.2s;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); 
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.selected-bg {
    border: 3px dashed #000000; 
}

.color-circle.selected-fg {
    border: 4px solid #6afe6f; 
}

.color-name-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4c4c4c; 
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
}

.color-circle:hover .color-name-tooltip {
    opacity: 1;
    visibility: visible;
}


.controls {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.clear {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
    font-weight: bold;
}

.clear:hover {
    background-color: #d32f2f;
}

#brushSizeValue, #brushMixStrength {
    font-size: 11px; /* 减小字体大小 */
    color: #a0a0a0; /* 使颜色更柔和 */
    min-width: 16px; /* 确保数字有足够的空间 */
    display: inline-block;
    text-align: right; /* 数字右对齐 */
}

.brush-size {
    display: flex;
    align-items: center;
    gap: 2px;
}

.brush-size label {
    font-size: 12px;
    color: #ffffff; 
}

.brush-size input[type="range"] {
    width: 50px;
    background-color: #3c3c3c; 
}

.brush-size label + input + span + span {
    font-size: 5px;
    color: #a0a0a0;
}

.brush-preview-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-color: #3c3c3c; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #4c4c4c; 
}

.brush-preview-btn:hover {
    background-color: #4c4c4c; 
}

.history-buttons {
    display: flex;
    gap: 4px;
}

.history-buttons button {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-color: #3c3c3c; 
    border: 1px solid #4c4c4c; 
    font-size: 18px;
    cursor: pointer;
    color: #e0e0e0; 
}

.history-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.history-buttons button:hover:not(:disabled) {
    background-color: #4c4c4c; 
}


.tool-buttons {
    display: flex;
    gap: 3px;
    margin-left: 8px;
}

.tool-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background-color: #3c3c3c;
    border: 1px solid #4c4c4c;
    font-size: 18px;
    cursor: pointer;
    color: #e0e0e0;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: #4c4c4c;
}

.tool-btn.active {
    background-color: #2196F3;
    border-color: #1976D2;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.5);
}


.mix-area-container {
    margin-bottom: 5px;
}

.mix-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.mix-area-header h3 {
    font-size: 14px;
    color: #e0e0e0; 
}

.color-indicators {
    display: flex;
    gap: 15px;
}

.color-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #b0b0b0; 
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.color-box.foreground {
    border: 2px solid #fff; 
}

.color-box.background {
    border: 2px dashed #fff; 
}

.mix-area {
    border: 1px solid #4c4c4c; 
    border-radius: 8px;
    overflow: hidden;
    background-color: #2c2c2c; 
}

#mixCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#mixCanvas.brush {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="6" fill="rgba(255,255,255,0.4)"/></svg>') 12 12, auto; 
}

#mixCanvas.eyedropper {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.5 2.5L23 8l-15 15H2v-6L17.5 2.5z" stroke="white" stroke-width="2" fill="#333"/></svg>') 2 22, auto; 
}


.info {
    background-color: #2c2c2c; 
    padding: 15px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #b0b0b0; 
}

.info p {
    margin-bottom: 5px;
}

.info strong {
    color: #e0e0e0; 
}


.brush-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.brush-selector-modal.active {
    opacity: 1;
    visibility: visible;
}

.brush-selector-content {
    background-color: #2c2c2c; 
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #e0e0e0; 
}

.brush-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.brush-selector-header h3 {
    font-size: 18px;
    color: #e0e0e0; 
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #b0b0b0; 
}

.brush-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.brush-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.brush-option:hover {
    background-color: #3c3c3c; 
}

.brush-option.selected {
    background-color: #1e3a5f; 
}

.brush-option canvas {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
}

.brush-option-name {
    font-size: 12px;
    text-align: center;
    color: #b0b0b0; 
}

.custom-brush-upload {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #3c3c3c; 
}

.custom-brush-upload label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #b0b0b0; 
}

.custom-brush-upload input[type="file"] {
    display: none;
}

.upload-btn {
    background-color: #2196F3; 
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
}

.upload-btn:hover {
    background-color: #1976D2;
}