body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1b1c1c;
    background-color: #faf9f9;
}

.font-headline {
    font-family: 'Plus Jakarta Sans', "Noto Sans SC", sans-serif;
}

.card {
    background: #ffffff;
    border: none;
    border-radius: 2rem;
    /* ultra-rounded */
    padding: 2rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    /* Soft, expansive shadow */
}

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1b1c1c;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Plus Jakarta Sans', "Noto Sans SC", sans-serif;
}

.card-title::before {
    content: '';
    width: 6px;
    height: 1.1em;
    background: #ba0036;
    /* Crimson Red */
    border-radius: 3px;
}

.label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #474646;
    margin-bottom: 0.5rem;
}

.input {
    width: 100%;
    background: #efeded;
    border: none;
    border-radius: 1rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    color: #1b1c1c;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-sizing: border-box;
}

.input::placeholder {
    color: #767474;
}

.input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 2px #ba0036;
}

textarea.input {
    resize: vertical;
}

.style-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(180deg, #f7f4f5 0%, #ebe7e8 100%);
    border: 1px solid #e2dcde;
    border-radius: 1.25rem;
    box-shadow: inset 0 1px 2px rgba(27, 28, 28, 0.06);
}

.style-mode-tab {
    min-height: 44px;
    border: none;
    border-radius: 0.9rem;
    background: transparent;
    color: #767474;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.style-mode-tab.active {
    background: #ffffff;
    color: #ba0036;
    box-shadow: 0 6px 16px rgba(186, 0, 54, 0.12), 0 1px 3px rgba(27, 28, 28, 0.08);
}

.style-mode-tab:hover:not(.active) {
    color: #1b1c1c;
    background: rgba(255, 255, 255, 0.55);
}

.style-mode-tab:active {
    transform: scale(0.98);
}

.field-hint {
    margin-top: 0.5rem;
    color: #767474;
    font-size: 0.78rem;
    line-height: 1.5;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 9999px;
    /* Pill */
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    line-height: 1.25;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: #ba0036;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(186, 0, 54, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: #e21e4a;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(186, 0, 54, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-secondary {
    background: #f4f3f3;
    color: #1b1c1c;
}

.btn-secondary:hover:not(:disabled) {
    background: #e9e8e8;
    transform: scale(1.02);
}

.btn-secondary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-ghost {
    background: transparent;
    color: #474646;
}

.btn-ghost:hover:not(:disabled) {
    background: #efeded;
    color: #1b1c1c;
    transform: scale(1.02);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.loader {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary .loader {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
}

.btn-secondary .loader,
.btn-ghost .loader {
    border: 2px solid rgba(186, 0, 54, 0.2);
    border-top-color: #ba0036;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.canvas-container {
    position: relative;
    background: #f4f3f3;
    border-radius: 1.5rem;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.canvas-container.square {
    aspect-ratio: 1 / 1;
}

.canvas-el {
    width: 100%;
    height: 100%;
    cursor: move;
    display: block;
}

.layer-panel {
    background: #faf9f9;
    border: 1px solid #efeded;
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.2s;
}

.layer-panel:hover {
    border-color: #dbdad9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.tag-chip {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: #ffdada;
    color: #93000a;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
}

.success-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #e6f4ea;
    border-radius: 1rem;
    color: #137333;
    font-weight: 500;
}

.copy-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f4f3f3;
    border-radius: 1.5rem;
}

.copy-btn {
    background: #ffffff;
    color: #ba0036;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: none;
}

.copy-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: scale(1.02);
}

.download-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem;
    background: #ba0036;
    color: #ffffff;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(186, 0, 54, 0.2);
}

.download-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(186, 0, 54, 0.3);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #efeded;
    border-radius: 4px;
    outline: none;
    margin-top: 0.5rem;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ba0036;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(186, 0, 54, 0.4);
    border: 2px solid #ffffff;
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: transparent;
    width: 32px;
    height: 32px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #faf9f9;
}

::-webkit-scrollbar-thumb {
    background: #dbdad9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c9c6c5;
}

/* 图片大图查看模态框样式 */
.animate-in {
    animation: fadeIn 0.2s ease-out;
}

.fade-in {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 键盘导航支持 */
.image-viewer-modal {
    outline: none;
}

/* 图片加载动画 */
.image-viewer-modal img {
    transition: opacity 0.3s ease-in-out;
}

.image-viewer-modal img:not([src]) {
    opacity: 0;
}
