body {
    margin: 0;
    padding: 8px;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin: 6px 0;
    font-weight: 600;
    font-size: 1.4rem;
}

.form-container {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .1);
    max-width: 800px;
    margin: 0 auto 12px;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 0;
}

.form-group label {
    flex: 0 0 120px;
    color: #4a5568;
    font-weight: 500;
    font-size: .95rem;
}

.form-group input,
.form-group select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .95rem;
    transition: all .2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: 0;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, .15);
}

.form-group input[type=number] {
    width: 120px;
}

.form-group input[type=file] {
    padding: 8px;
    background: #f7fafc;
    cursor: pointer;
}

.color-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.color-group input[type=text] {
    flex: 3;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .95rem;
}

.color-group input[type=color] {
    flex: 1;
    width: 50px;
    height: 38px;
    padding: 2px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

button:first-child {
    background: #4299e1;
    color: #fff;
}

button:last-child {
    background: #48bb78;
    color: #fff;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.canvas-container {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.title-with-button {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .05);
    flex: 1;
    min-width: 45%;
    max-width: 48%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-with-button h3 {
    color: #2d3748;
    margin: 0 0 15px;
    font-size: 1.1rem;
    text-align: center;
}

.title-with-button-compose {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    justify-content: center;
    width: 100%;
    min-height: 40px;
}

.title-with-button-compose h3 {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 100%;
}

canvas {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.download-container {
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.download-container a {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: #48bb78;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all .2s;
    height: fit-content;
}

.download-container a:hover {
    background: #38a169;
    transform: translateY(-1px);
}

@media (max-width: 1200px) {
    .canvas-container {
        flex-direction: column;
    }

    .title-with-button {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px;
    }

    .form-container {
        padding: 15px;
        margin: 0 auto 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .form-group {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .form-group label {
        flex: none;
        margin-bottom: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .form-group input,
    .form-group select {
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    .color-group {
        width: 100%;
        box-sizing: border-box;
    }

    .color-group input[type=text] {
        flex: 3;
        width: 0;
        min-width: 0;
    }

    .color-group input[type=color] {
        flex: 1;
        width: 0;
        min-width: 0;
    }

    .form-group input[type=number] {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .button-group button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .form-container {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
}

[id^=originalCanvas],
[id^=watermarkedCanvas] {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    margin-top: 10px;
}

.tool-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 8px;
    color: #666;
    line-height: 1.6;
    padding: 0 12px;
    font-size: .95rem;
}

footer {
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    color: #666;
    border-top: 1px solid #eee;
}

main {
    min-height: auto;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #4299e1;
    transition: width .3s ease;
}

.progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    text-shadow: 0 0 2px rgba(0, 0, 0, .5);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-text {
    color: #fff;
    margin-bottom: 10px;
    font-size: 16px;
}

.progress-container {
    width: 300px;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loading-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    z-index: 1;
    white-space: nowrap;
}

.progress-bar {
    transition: width .3s ease-out;
}

[v-cloak] {
    display: none !important;
}

.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fc8181;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.error-message.show {
    opacity: 1;
    visibility: visible;
}

.settings-group {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 10px;
}

.settings-group h4 {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
    font-size: .95rem;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.range-group input[type=range] {
    flex: 2;
    height: 38px;
    padding: 0;
    margin: 12px 0;
}

.range-group .number-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .95rem;
    transition: all .2s;
    background: #fff;
}

.range-group .number-input:focus {
    outline: 0;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, .15);
}

.range-group input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4299e1;
    border-radius: 50%;
    cursor: pointer;
    transition: all .2s;
}

.range-group input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #3182ce;
}

.range-group input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4299e1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all .2s;
}

.range-group input[type=range]::-moz-range-thumb:hover {
    transform: scale(1.1);
    background: #3182ce;
}

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        margin-bottom: 6px;
    }

    .range-group {
        flex-direction: column;
        width: 100%;
        gap: 6px;
    }

    .range-group input[type=range] {
        width: 100%;
        margin: 0;
    }

    .range-group .number-input {
        width: 100%;
        box-sizing: border-box;
    }
}

.mode-control {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

#watermarkMode {
    width: 100%;
    height: 38px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .95rem;
    background: #fff;
    transition: all .2s;
}

.mode-control.with-undo #watermarkMode {
    flex: .85;
    width: auto;
}

.undo-button {
    flex: .15;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #edf2f7 !important;
    cursor: pointer;
    font-size: .95rem;
    color: #4a5568 !important;
    transition: all .2s;
    white-space: nowrap;
    min-width: fit-content;
}

.undo-button:hover {
    background: #e2e8f0 !important;
    border-color: #a0aec0;
    color: #2d3748 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.undo-button:active {
    background: #cbd5e0 !important;
    transform: translateY(1px);
}

.undo-button {
    position: relative;
    transition: all 0.3s ease;
}

.undo-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes numberChange {
    from {
        transform: translateY(-5px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.undo-button span {
    display: inline-block;
    animation: numberChange 0.3s ease;
}

@media (max-width: 768px) {
    .undo-button {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}
