* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Helvetica Neue', sans-serif;
    display: flex;
    height: 100vh;
    background-color: #f0f2f5;
}

.left-panel {
    position: relative;
    /* 保留这个 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* padding: 10px; */
    flex: 8;
    background-color: #faf7f7;
    color: white;
}

.left-panel .form-group {
    margin-top: 20px;
    padding: 10px;
}

.background-wrapper {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}


.background-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.bg-btn {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border 0.3s;
    opacity: 0.8;
}

.bg-btn:hover {
    /* background-color: #e6f7ff; */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.bg-btn.selected {
    /* border: 2px solid #00f0ff; */
    border-color: #007bff;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    /* background: linear-gradient(135deg, #e0f0ff, #ffffff); */
}

.bg-btn.upload-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    border: 2px dashed #bbb;
    cursor: pointer;
    opacity: 0.8;
    overflow: hidden;
    background-color: #f7f7f7;
}

.bg-btn.upload-btn span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    color: #888;
    pointer-events: none;
}

.bg-btn.upload-btn input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    left: 0;
    top: 0;
}


#priceDisplay {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    color: black;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 10;
}


/* .svgWrapper {
    position: relative;
    width: 100%;
    height: 100%;
} */
.svgWrapper {
    position: relative;
    width: 100%;
    height: 100%;
    /* 或者固定高度，如 500px */
    overflow: hidden;
    /* 关键：超出部分隐藏，不出现滚动条 */
    background-color: #333;
    /* 临时背景色，方便看清边界 */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    /* 提示用户可以拖拽画布 */
}

.svgWrapper:active {
    cursor: grabbing;
}


.line {
    position: absolute;
    background: #e0e0e0;
    /* 基础颜色 */
    transition: all 0.4s ease;
    /* 添加过渡动画 */
    z-index: 10;
}

.horizontal-line {
    height: 1px;
    /* 线宽 */
    width: 100%;
    bottom: 25px;
    /* 距离 SVG 稍微远一点，美观 */
    left: 0;

    /* box-shadow: 0 0 5px rgba(0, 0, 0, 0.5), 0 0 5px rgba(0, 0, 0, 0.5); */
    /* 羽化效果 */


    background: linear-gradient(to right, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
    /* 渐变色 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* 添加阴影 */
    border-radius: 1px;
    /* 圆角效果 */
}

.vertical-line {
    width: 1px;
    /* 线宽 */
    height: 100%;
    left: 25px;
    /* 距离 SVG 稍微远一点，美观 */
    top: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.1) 100%);
    /* 渐变色 */
    /* 渐变色 */
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);
    /* 阴影效果 */
    border-radius: 1px;
    /* 圆角效果 */
}

/* 为线条两端添加原点 */
.horizontal-line::before,
.horizontal-line::after,
.vertical-line::before,
.vertical-line::after {
    content: '';
    position: absolute;
    width: 12px;
    /* 原点直径 */
    height: 12px;
    /* 原点直径 */
    border-radius: 70%;
    /* 圆形 */
    background: radial-gradient(circle, #ffffff, #cec3c3);
    /* 从白色到黑色的径向渐变 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* 使原点更具层次感 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* 动画效果 */
}

/* 横线左端的原点 */
.horizontal-line::before {
    left: -5px;
    /* 使原点处于线条的左端 */
    top: 50%;
    transform: translateY(-50%);
}

/* 横线右端的原点 */
.horizontal-line::after {
    right: -5px;
    /* 使原点处于线条的右端 */
    top: 50%;
    transform: translateY(-50%);
}

/* 纵线顶部的原点 */
.vertical-line::before {
    top: -5px;
    /* 使原点处于线条的顶部 */
    left: 50%;
    transform: translateX(-50%);
}

/* 纵线底部的原点 */
.vertical-line::after {
    bottom: -5px;
    /* 使原点处于线条的底部 */
    left: 50%;
    transform: translateX(-50%);
}

.length-label,
.height-label {
    position: absolute;
    font-size: 12px;
    font-family: 'Helvetica Neue', 'Arial', 'sans-serif';
    /* 更现代干净的字体 */
    color: #333;
    /* 深灰色，比纯黑更柔和 */
    font-weight: 600;
    /* 半粗体，专业感 */
    background: rgba(255, 255, 255, 0.8);
    /* 半透明白色背景，增加可读性 */
    padding: 2px 0px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    /* 细腻的阴影 */
    backdrop-filter: blur(4px);
    /* 毛玻璃效果，增加层次感（可选） */
    white-space: nowrap;
}

.length-label {
    bottom: 0px;
    /* 使数字在横线下方 */
    left: 50%;
    transform: translateX(-50%);
    /* 居中 */
}

.height-label {
    /* left: -0px;
    top: 50%;
    transform: translateY(-50%); */
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
}


.svgContainer {
    position: absolute;
    top: 40%;
    left: 50%;
    width: 100%;
    height: 40%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


/* 右侧面板整体容器 */
.right-panel {
    flex: 2;
    /* 稍微加宽一点比例，让内容不拥挤 */
    background-color: #ffffff;
    border-left: 1px solid #e5e7eb;
    /* 细微的分割线代替阴影 */
    box-shadow: none;
    /* 去掉大阴影，更扁平 */
    padding: 40px 30px;
    /* 增加内边距 */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    /* 增加模块间的间距 */
}

/* 表单组容器 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
    /* 每个板块之间加淡分割线 */
}

.form-group:last-child {
    border-bottom: none;
}

/* 标签样式 - 商务风通常使用全大写或深灰色 */
label,
.form-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    /* 次级文本颜色 */
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

/* 输入框优化 */
textarea,
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    color: #1f2937;
    background-color: #f9fafb;
    /* 极淡的灰色背景 */
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
    resize: vertical;
}

textarea:focus,
input:focus {
    background-color: #ffffff;
    border-color: #2563eb;
    /* 商务蓝 */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    /* 聚焦时的柔和光环 */
    outline: none;
}

/* 提示文字 */
#charLimitTip {
    font-size: 12px;
    margin-top: 6px;
    color: #ef4444 !important;
    /* 错误色 */
}

select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.color-options {
    /* display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
    max-width: 600px; */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 列 */
    grid-gap: 12px;
    /* 项目之间的间距，随你调整 */
    padding: 10px;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.color-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

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

.color-btn.selected {
    border-color: #007bff;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
}

.color-label {
    margin-top: 8px;
    color: #333;
}

@keyframes rainbowShift {
    0% {
        background-color: hsl(0, 100%, 50%);
    }

    25% {
        background-color: hsl(120, 100%, 50%);
    }

    50% {
        background-color: hsl(240, 100%, 50%);
    }

    75% {
        background-color: hsl(300, 100%, 50%);
    }

    100% {
        background-color: hsl(360, 100%, 50%);
    }
}

.rainbow-btn {
    animation: rainbowShift 5s linear infinite;
}

.rainbow-btn1 {
    background: linear-gradient(90deg,
            #fdfdfd,
            #e6de8e,
            #FF0000,
            #f7cd19,
            #ecdd68,
            #8eea33,
            #57ead9,
            #4c45e6,
            #ac04f3,
            #ff00de,
            #fdfdfd);
    background-size: 300% 100%;
    animation: rainbowFlow 2s linear infinite;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
}

@keyframes rainbowFlow {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


@keyframes rainbowGlow {
    0% {
        filter: drop-shadow(0 0 3px #fdfdfd) drop-shadow(0 0 6px #fdfdfd);
        /* White */
    }

    10% {
        filter: drop-shadow(0 0 3px #e6de8e) drop-shadow(0 0 6px #e6de8e);
        /* Beige */
    }

    20% {
        filter: drop-shadow(0 0 3px #FF0000) drop-shadow(0 0 6px #FF0000);
        /* Red */
    }

    30% {
        filter: drop-shadow(0 0 3px #f7cd19) drop-shadow(0 0 6px #f7cd19);
        /* Yellow */
    }

    40% {
        filter: drop-shadow(0 0 3px #ecdd68) drop-shadow(0 0 6px #ecdd68);
        /* Gold */
    }

    50% {
        filter: drop-shadow(0 0 3px #8eea33) drop-shadow(0 0 6px #8eea33);
        /* Green */
    }

    60% {
        filter: drop-shadow(0 0 3px #57ead9) drop-shadow(0 0 6px #57ead9);
        /* Cyan */
    }

    70% {
        filter: drop-shadow(0 0 3px #4c45e6) drop-shadow(0 0 6px #4c45e6);
        /* Blue */
    }

    80% {
        filter: drop-shadow(0 0 3px #ac04f3) drop-shadow(0 0 6px #ac04f3);
        /* Purple */
    }

    90% {
        filter: drop-shadow(0 0 3px #ff00de) drop-shadow(0 0 6px #ff00de);
        /* Pink */
    }

    100% {
        filter: drop-shadow(0 0 3px #fdfdfd) drop-shadow(0 0 6px #fdfdfd);
        /* Loop back to White */
    }
}


.rainbow-glow {
    animation: rainbowGlow 10s linear infinite;
}


@keyframes rainbowFill {
    0% {
        fill: hsl(0, 100%, 50%);
    }

    25% {
        fill: hsl(120, 100%, 50%);
    }

    50% {
        fill: hsl(240, 100%, 50%);
    }

    75% {
        fill: hsl(300, 100%, 50%);
    }

    100% {
        fill: hsl(360, 100%, 50%);
    }
}

.rainbow-fill {
    animation: rainbowFill 5s linear infinite;
}



.glow-toggle-container {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
}

.glow-switch {
    position: relative;
    width: 120px;
    height: 40px;
    background: #111;
    border-radius: 20px;
    border: 2px solid #00ffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: sans-serif;
    overflow: hidden;
    user-select: none;
    position: relative;
}

.glow-label {
    flex: 1;
    text-align: center;
    z-index: 2;
    color: #888;
    font-weight: bold;
    font-size: 14px;
    transition: color 0.3s;
    pointer-events: none;
}

.glow-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 6px);
    height: calc(100% - 6px);
    background: #00ffff;
    border-radius: 16px;
    transition: left 0.3s ease;
    z-index: 1;
}

/* 激活时移动到右侧 */
.glow-switch.off .glow-indicator {
    left: calc(50% + 3px);
}

.glow-switch.on .glow-label.on,
.glow-switch.off .glow-label.off {
    color: #000;
}


/* 字体选择器外观 */
.font-selector {
    position: relative;
    width: 100%;
}

.selected-font {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.selected-font:hover {
    border-color: #9ca3af;
}

#fontName {
    font-size: 16px;
    color: #111827;
}

.arrow {
    font-size: 12px;
    color: #6b7280;
}


.font-selector {
    position: relative;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px;
    background: #fff;
    cursor: pointer;
    width: 100%;
}

.selected-font {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
}

.arrow {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.arrow.up {
    transform: rotate(180deg);
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 5px;
    margin-top: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    z-index: 10;
}

.font-grid div {
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
    background-color: #f9f9f9;
}

.font-grid div:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.font-option {
    font-size: 16px;
    max-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 1px solid #ccc;
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer;
    color: #000;
    white-space: nowrap;
}



.font-option:hover {
    background: #eee;
    border-color: #ccc;
}

.font-option.selected {
    background-color: #d0eaff;
    border-color: #3399ff;
    font-weight: bold;
}


.backboard-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.backboard-btn {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    text-align: left;
    /* border: 1px solid #ccc; */
    border: 2px solid transparent;
    background-color: #f8f8f8;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 1.4;
}

.backboard-btn small {
    display: block;
    color: #666;
    font-size: 13px;
}

.backboard-btn:hover {
    /* background-color: #e6f7ff; */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.backboard-btn.active {
    /* border-color: #007bff;
    background-color: #cce5ff; */
    border-color: #007bff;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #e0f0ff, #ffffff);
}



.stroke-color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.stroke-color-card {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.stroke-color-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.stroke-color-card.selected {
    /* border-color: #333;
    background: #fff; */
    border-color: #007bff;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #e0f0ff, #ffffff);
}

.color-preview {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid #bbb;
    margin-right: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.color-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: #888;
}

.color-info {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.color-name {
    font-weight: bold;
}

.color-price {
    font-size: 14px;
    color: #e53935;
    /* 明亮的红色或你喜欢的强调色 */
    font-weight: bold;
    /* background-color: #ffeaea; */
    /* 淡红色背景增强对比 */
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.size-container {
    display: grid;
    /* grid-template-columns: 1fr 1fr; */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    max-width: 700px;
    margin-bottom: 20px;
}

.size-card {
    /* border: 2px solid #ccc; */
    border: 2px solid transparent;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: all 0.1s;
}

.size-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.size-card.selected {
    border-color: #007bff;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #e0f0ff, #ffffff);
}

/* .manual-input {
    display: none;
    margin-top: 10px;
}

.manual-input input {
    width: 100px;
    margin-right: 10px;
} */

.size-card.manual {
    padding: 16px;
    background: linear-gradient(135deg, #f9f9f9, #ffffff);
    border: 2px solid #ccc;
    border-radius: 10px;
    box-shadow: none;
    transition: all 0.2s ease;
    /* grid-column: span 2; */
}

.size-card.manual.selected {
    border-color: #007bff;
    box-shadow: 0 0 12px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #e0f0ff, #ffffff);
}

.manual-title {
    font-weight: 600;
    font-size: 18px;
    color: #007bff;
    margin-bottom: 10px;
}


.dropdown-selected {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f0f8ff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-arrow {
    font-size: 20px;
    /* 调整这个数值，默认可能是16px */
    /* margin-left: 10px; */
    transition: transform 0.3s ease;
}

/* 箭头旋转效果（激活时） */
.custom-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown {
    position: relative;
    width: 100%;
    /* font-size: 14px; */
    user-select: none;
}

.dropdown-selected {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f0f8ff;
    cursor: pointer;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 10px;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #d6ecff;
}

#neonPrice {
    font-weight: bold;
    text-align: center;
    margin: 0 auto;
    /* 水平居中 */
}


#submitButton {
    padding: 20px 24px;
    /* 上下12px，高度会根据字体大小自动调整 */
    font-size: 16px;
    background-color: #ff5e5e;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}


#submitButton:hover {
    background-color: #ff3b3b;
}


.icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.icon-item {
    aspect-ratio: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #fff;
    padding: 5px;
}

.icon-item:hover {
    border-color: #1890ff;
    background-color: #e6f7ff;
    transform: translateY(-2px);
}

.icon-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#global-backboard-layer,
#global-backboard-layer * {
    box-sizing: border-box !important;
}


.hidden {
    display: none;
}


.etsy-warning {
    text-transform: none;
    color: red;
}