* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #ECFEFF 0%, #E0F2FE 100%);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 500px;
    width: 100%;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.08);
}

.logo-container {
    text-align: center;
    margin-bottom: 15px;
}

.logo {
    width: 50px;
    height: 50px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #164E63;
    margin-bottom: 8px;
    text-align: center;
}

h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #0891B2;
    margin: 16px auto 24px;
    border-radius: 2px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #164E63;
}

select, input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E0F2FE;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: #164E63;
    background: #F0F9FF;
    transition: all 0.2s ease;
}

/* 移除 number 输入框的上下箭头 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #0891B2;
    background: white;
}

.style-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.style-card {
    padding: 16px;
    border: 2px solid #E0F2FE;
    border-radius: 8px;
    background: #F0F9FF;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.style-card:hover {
    border-color: #22D3EE;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
}

.style-card.active {
    border-color: #0891B2;
    background: white;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.style-card-title {
    font-weight: 600;
    font-size: 16px;
    color: #164E63;
    margin-bottom: 4px;
}

.style-card-desc {
    font-size: 13px;
    color: #0891B2;
}

.preview-icon {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: #E0F2FE;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.preview-icon:hover {
    background: #0891B2;
    transform: scale(1.1);
}

.preview-popup {
    display: none;
    position: fixed;
    width: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.preview-popup.show {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.preview-popup img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.custom-config {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #F0F9FF;
    border-radius: 8px;
    border: 2px solid #E0F2FE;
}

.config-row {
    margin-bottom: 16px;
}

.config-row label {
    margin-bottom: 6px;
}

.config-row input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E0F2FE;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: #164E63;
    background: white;
    transition: all 0.2s ease;
}

.config-row input[type="number"]:focus {
    outline: none;
    border-color: #0891B2;
}

.small-btn {
    padding: 8px 16px;
    background: #0891B2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.small-btn:hover {
    background: #0E7490;
}

.row-color-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.row-color-item input[type="number"] {
    width: 70px;
    padding: 8px;
    border: 2px solid #E0F2FE;
    border-radius: 6px;
    font-size: 14px;
}

.row-color-item input[type="text"] {
    width: 100px;
    padding: 8px;
    border: 2px solid #E0F2FE;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
}

.color-picker-btn {
    width: 40px;
    height: 40px;
    border: 3px solid #E0F2FE;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-picker-btn:hover {
    border-color: #0891B2;
    transform: scale(1.1);
}

.row-color-item button {
    width: 28px;
    height: 28px;
    padding: 0;
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.row-color-item button.cmyk-btn {
    width: auto;
    padding: 6px 10px;
    background: #E0F2FE;
    color: #0891B2;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.row-color-item button.cmyk-btn:hover {
    background: #0891B2;
    color: white;
}

.row-color-item button:hover {
    width: 28px;
    height: 28px;
    padding: 0;
    background: #FEE2E2;
    color: #DC2626;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.row-color-item button:hover {
    background: #DC2626;
    color: white;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #164E63;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.toast.error {
    background: #DC2626;
}

.cmyk-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.cmyk-modal.show {
    display: flex;
}

.cmyk-modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 300px;
}

.cmyk-modal-content h3 {
    margin-bottom: 16px;
    color: #164E63;
    font-size: 18px;
}

.cmyk-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.cmyk-inputs div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cmyk-inputs label {
    font-size: 13px;
    font-weight: 600;
    color: #0891B2;
}

.cmyk-inputs input {
    padding: 8px;
    border: 2px solid #E0F2FE;
    border-radius: 6px;
    font-size: 14px;
}

.cmyk-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #0891B2;
}

.switch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #CBD5E1;
    border-radius: 26px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background: #0891B2;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider:hover {
    box-shadow: 0 0 8px rgba(8, 145, 178, 0.3);
}

textarea {
    font-family: monospace;
    resize: vertical;
}

button {
    width: 100%;
    padding: 14px;
    background: #22C55E;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

button:hover {
    background: #16A34A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #CBD5E1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#status {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

#status.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

#status.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}
