/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 50%, #0d0d1a 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e0e0ff;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(120, 119, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow:
        0 0 40px rgba(120, 119, 255, 0.2),
        0 0 80px rgba(255, 0, 128, 0.1),
        inset 0 0 60px rgba(120, 119, 255, 0.05);
    overflow: visible;
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    position: relative;
    z-index: 1;
}

/* 头部 */
header {
    background: linear-gradient(135deg, #1a1a3e 0%, #2a2a5e 50%, #1a1a3e 100%);
    color: #e0e0ff;
    padding: 40px 30px;
    text-align: center;
    border-radius: 16px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(120, 119, 255, 0.3);
    box-shadow:
        0 0 20px rgba(120, 119, 255, 0.2),
        inset 0 0 20px rgba(120, 119, 255, 0.1);
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(120, 119, 255, 0.1), transparent);
    animation: headerGlow 15s infinite linear;
    pointer-events: none;
}

@keyframes headerGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    position: relative;
    text-shadow: 0 0 20px rgba(120, 119, 255, 0.8);
    background: linear-gradient(135deg, #00f0ff 0%, #ff00ff 50%, #00f0ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 5s ease infinite;
}

@keyframes textGradient {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.subtitle {
    font-size: 14px;
    opacity: 0.8;
    color: #a0a0c0;
}

/* 主内容区 */
.main-content {
    flex: 1;
    min-width: 0;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 18px;
    margin: 0;
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    color: #0a0e27;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.btn-add svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.btn-add:hover {
    background: linear-gradient(135deg, #00f0ff 0%, #00c0ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.btn-add:active {
    transform: translateY(0);
}

.btn-add:disabled {
    background: #3a3a5c;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.images-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-item {
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(20, 20, 40, 0.6);
    backdrop-filter: blur(10px);
}

.image-item:hover {
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.image-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1a1a3e 0%, #2a2a5e 100%);
    color: #e0e0ff;
    border-bottom: 1px solid rgba(120, 119, 255, 0.2);
}

.image-item-header h3 {
    font-size: 16px;
    margin: 0;
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.image-item-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.enable-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.enable-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00f0ff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ff00ff;
}

.checkbox-label:hover {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.btn-delete {
    background: rgba(255, 0, 80, 0.2);
    border: 1px solid rgba(255, 0, 80, 0.5);
    color: #ff0080;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: rgba(255, 0, 80, 0.3);
    box-shadow: 0 0 10px rgba(255, 0, 80, 0.5);
}

.image-item-controls {
    padding: 15px 20px;
    background: rgba(15, 15, 30, 0.4);
}

.upload-area {
    border: 2px dashed rgba(120, 119, 255, 0.4);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(20, 20, 40, 0.4);
}

.upload-area:hover {
    border-color: rgba(0, 240, 255, 0.8);
    background: rgba(30, 30, 60, 0.6);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.upload-area.dragover {
    border-color: #00f0ff;
    background: rgba(0, 240, 255, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
}

.upload-area.has-image {
    padding: 20px;
    border-style: solid;
    border-color: rgba(0, 255, 128, 0.6);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
    color: #00f0ff;
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.8));
}

.upload-text {
    color: #a0a0c0;
    font-size: 16px;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    display: block;
    margin: 0 auto 10px;
    border-radius: 8px;
    border: 1px solid rgba(120, 119, 255, 0.3);
}

.file-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(0, 255, 128, 0.1);
    border: 1px solid rgba(0, 255, 128, 0.3);
    border-radius: 6px;
    color: #00ff80;
    font-size: 13px;
    text-align: center;
}

.image-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.image-control-item {
    display: flex;
    flex-direction: column;
}

.image-control-item label {
    font-size: 12px;
    font-weight: 600;
    color: #00f0ff;
    margin-bottom: 4px;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

.image-control-item .slider-value {
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    color: #0a0e27;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: normal;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.full-width {
    grid-column: 1 / -1;
}

/* 输入区域 */
.input-section {
    margin-bottom: 30px;
}

/* 字体上传栏 */
.font-upload-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid rgba(120, 119, 255, 0.2);
    border-radius: 10px;
    background: rgba(20, 20, 40, 0.4);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.btn-upload-font {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(120, 119, 255, 0.4);
    border-radius: 6px;
    background: rgba(120, 119, 255, 0.15);
    color: #c0c0ff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-upload-font:hover {
    background: rgba(120, 119, 255, 0.3);
    border-color: rgba(120, 119, 255, 0.6);
    color: #fff;
}

.btn-upload-font svg {
    flex-shrink: 0;
}

.custom-fonts-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-font-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 6px;
    background: rgba(120, 119, 255, 0.1);
    font-size: 13px;
    color: #e0e0ff;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-font-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 80, 80, 0.2);
    color: #ff6b6b;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.custom-font-remove:hover {
    background: rgba(255, 80, 80, 0.5);
    color: #fff;
}

.text-boxes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.text-box-item {
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(20, 20, 40, 0.6);
    backdrop-filter: blur(10px);
}

.text-box-item:hover {
    border-color: rgba(255, 0, 128, 0.6);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.3);
}

.text-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2a1a3e 0%, #3a2a5e 100%);
    color: #e0e0ff;
    border-bottom: 1px solid rgba(255, 0, 128, 0.2);
}

.text-box-header h3 {
    font-size: 16px;
    margin: 0;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
}

.text-box-controls {
    padding: 15px 20px;
    background: rgba(15, 15, 30, 0.4);
}

.control-row {
    margin-bottom: 12px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row > label {
    display: block;
    font-weight: 600;
    color: #ff00ff;
    margin-bottom: 6px;
    font-size: 13px;
    text-shadow: 0 0 5px rgba(255, 0, 128, 0.3);
}

.control-col {
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    vertical-align: top;
}

.control-col:last-child {
    margin-right: 0;
}

.control-col label {
    display: block;
    font-weight: 600;
    color: #ff00ff;
    margin-bottom: 4px;
    font-size: 13px;
    text-shadow: 0 0 5px rgba(255, 0, 128, 0.3);
}

.text-content-input {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s;
    background: rgba(15, 15, 30, 0.8);
    color: #e0e0ff;
}

.text-content-input:focus {
    outline: none;
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.4);
    background: rgba(25, 25, 50, 0.9);
}

.font-family-select,
.text-direction-select,
.blend-mode-select,
.processing-method-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(15, 15, 30, 0.8);
    color: #e0e0ff;
    cursor: pointer;
    transition: all 0.3s;
}

.font-family-select:focus,
.text-direction-select:focus,
.blend-mode-select:focus,
.processing-method-select:focus {
    outline: none;
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.4);
}

.font-family-select option,
.text-direction-select option,
.blend-mode-select option,
.processing-method-select option {
    background: #1a1a3e;
    color: #e0e0ff;
    font-size: 14px;
    line-height: 1.5;
    padding: 4px 0;
}

.font-family-select optgroup {
    font-style: normal;
    font-weight: bold;
    color: #a0a0ff;
    font-size: 12px;
    background: #12122a;
}

.font-size-slider {
    width: calc(100% - 60px);
    vertical-align: middle;
}

.position-x-input,
.position-y-input,
.image-x-input,
.image-y-input,
.image-scale-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.3s;
    background: rgba(15, 15, 30, 0.8);
    color: #e0e0ff;
}

.position-x-input:focus,
.position-y-input:focus,
.image-x-input:focus,
.image-y-input:focus,
.image-scale-input:focus {
    outline: none;
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    background: rgba(25, 25, 50, 0.9);
}

/* 控制面板 */
.controls-section {
    margin-bottom: 30px;
    background: rgba(20, 20, 40, 0.6);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(120, 119, 255, 0.3);
}

.control-group {
    margin-bottom: 25px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #00f0ff;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

.control-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 6px;
    color: #00f0ff;
    font-size: 12px;
    line-height: 1.4;
}

.slider-value {
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    color: #0a0e27;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: normal;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(40, 40, 80, 0.6);
    outline: none;
    -webkit-appearance: none;
    margin: 10px 0;
    border: 1px solid rgba(120, 119, 255, 0.3);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.8);
    border: 2px solid #e0e0ff;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    cursor: pointer;
    border: 2px solid #e0e0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.8);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #8080a0;
}

/* 预览区域 */
.preview-section {
    position: sticky;
    top: 20px;
    width: 420px;
    flex-shrink: 0;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: rgba(20, 20, 40, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow:
        0 0 40px rgba(0, 240, 255, 0.2),
        inset 0 0 60px rgba(0, 240, 255, 0.05);
    padding: 20px;
    border: 1px solid rgba(0, 240, 255, 0.4);
}

.preview-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #00f0ff;
    text-align: center;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.8);
}

.preview-controls {
    background: rgba(15, 15, 30, 0.6);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(120, 119, 255, 0.3);
}

.preview-controls label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #00f0ff;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

.preview-container {
    position: relative;
    border: 2px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    padding: 10px;
    background: rgba(10, 10, 20, 0.8);
    overflow: auto;
    max-width: 100%;
    box-shadow:
        inset 0 0 30px rgba(0, 240, 255, 0.2),
        0 0 20px rgba(0, 240, 255, 0.3);
}

#previewCanvas {
    display: block;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: #0a0e27;
    image-rendering: pixelated;
    transform-origin: top left;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    cursor: default;
}

#previewCanvas:hover {
    cursor: grab;
}

#previewCanvas:active {
    cursor: grabbing;
}

.preview-label {
    display: flex;
    margin-top: 10px;
    font-size: 12px;
    color: #8080a0;
}

.preview-label span {
    flex: 1;
    padding: 5px;
    text-align: center;
}

.preview-label .label-image {
    border-right: 1px solid rgba(120, 119, 255, 0.2);
}

/* 操作按钮 */
.actions-section {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.btn-primary {
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    color: #0a0e27;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    border: 1px solid rgba(0, 240, 255, 0.5);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #00f0ff 0%, #00c0ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.7);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #3a3a5c;
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid rgba(120, 119, 255, 0.2);
}

.btn-secondary {
    background: rgba(120, 119, 255, 0.2);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(120, 119, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* 页脚 */
footer {
    background: rgba(15, 15, 30, 0.6);
    padding: 20px 30px;
    text-align: center;
    color: #8080a0;
    font-size: 13px;
    border-top: 1px solid rgba(120, 119, 255, 0.2);
    border-radius: 0 0 16px 16px;
    margin-top: 20px;
}

/* 布局包装 */
.content-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 15, 30, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00f0ff 0%, #00c0ff 100%);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }

    .preview-section {
        position: static;
        width: 100%;
        max-height: none;
    }

    .content-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 22px;
    }

    .container {
        padding: 10px;
    }

    .actions-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .text-box-item {
        font-size: 14px;
    }

    .control-col {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
    }
}

.btn-primary:not(:disabled) {
    animation: pulse 3s infinite;
}

/* 霓虹边框效果 */
.preview-container,
.image-item,
.text-box-item {
    position: relative;
}

.preview-container::before,
.image-item::before,
.text-box-item::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, #00f0ff, #ff00ff, #00f0ff);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.preview-container:hover::before,
.image-item:hover::before,
.text-box-item:hover::before {
    opacity: 0.5;
}

/* 输入框焦点发光效果 */
input:focus,
select:focus,
textarea:focus {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
    }
}

/* 边框控制显示动画 */
#borderControls,
#borderWidthControl {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 边框颜色选择器 */
#borderColorSelect {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(15, 15, 30, 0.9);
    color: #e0e0ff;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

#borderColorSelect:hover {
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

#borderColorSelect:focus {
    outline: none;
    border-color: #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
}

#borderColorSelect option {
    background: #1a1a3e;
    color: #e0e0ff;
}

/* 边框宽度滑块 */
#borderWidthSlider {
    background: linear-gradient(90deg,
        rgba(0, 240, 255, 0.3) 0%,
        rgba(255, 0, 128, 0.3) 100%);
}

/* 输出格式选择器 */
#outputFormatSelect {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(15, 15, 30, 0.9);
    color: #e0e0ff;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

#outputFormatSelect:hover {
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

#outputFormatSelect:focus {
    outline: none;
    border-color: #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
}

#outputFormatSelect option {
    background: #1a1a3e;
    color: #e0e0ff;
}

/* 尺寸输入控件样式 */
.size-inputs-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.size-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.size-input-wrapper label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #e0e0ff;
}

.size-input-wrapper input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(15, 15, 30, 0.9);
    color: #e0e0ff;
    transition: all 0.3s;
}

.size-input-wrapper input:focus {
    outline: none;
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.size-separator {
    font-size: 20px;
    color: #e0e0ff;
    font-weight: 500;
    padding-top: 20px;
}

.input-unit {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

/* 预设按钮样式 */
.size-presets {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-preset {
    padding: 6px 14px;
    background: rgba(15, 15, 30, 0.9);
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #e0e0ff;
    transition: all 0.2s ease;
}

.btn-preset:hover {
    background: rgba(26, 26, 62, 0.9);
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.btn-preset:active {
    background: rgba(26, 26, 62, 0.9);
    transform: translateY(1px);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .size-inputs-container {
        flex-direction: column;
    }

    .size-separator {
        transform: rotate(90deg);
        padding: 5px 0;
    }
}

/* EPD 字体工具面板 */
.epd-font-section {
    margin-bottom: 20px;
    border: 1px solid rgba(255, 160, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(20, 20, 40, 0.4);
    backdrop-filter: blur(10px);
}

.epd-font-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.epd-font-header:hover {
    background: rgba(255, 160, 0, 0.1);
}

.epd-font-header h2 {
    font-size: 16px;
    margin: 0;
    color: #ffa500;
    text-shadow: 0 0 10px rgba(255, 160, 0, 0.5);
}

.epd-font-header .toggle-arrow {
    color: #ffa500;
    font-size: 16px;
    transition: transform 0.3s;
}

.epd-font-body {
    padding: 0 20px 20px;
}

.epd-panel {
    padding: 15px;
    border: 1px solid rgba(120, 119, 255, 0.2);
    border-radius: 10px;
    background: rgba(15, 15, 30, 0.4);
    margin-bottom: 15px;
}

.epd-panel:last-child {
    margin-bottom: 0;
}

.epd-panel h3 {
    font-size: 14px;
    margin: 0 0 12px 0;
    color: #ffa500;
    text-shadow: 0 0 8px rgba(255, 160, 0, 0.4);
}

.epd-generate-info {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 160, 0, 0.1);
    border: 1px solid rgba(255, 160, 0, 0.2);
    border-radius: 6px;
    font-size: 13px;
    color: #ffa500;
}

.epd-progress {
    margin-top: 10px;
    position: relative;
    height: 24px;
    background: rgba(15, 15, 30, 0.8);
    border: 1px solid rgba(255, 160, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.epd-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffa500, #ff6600);
    transition: width 0.2s ease;
    border-radius: 5px;
}

.epd-progress span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

#epdSourceFont {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(15, 15, 30, 0.8);
    color: #e0e0ff;
    cursor: pointer;
    transition: all 0.3s;
}

#epdSourceFont:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 15px rgba(255, 160, 0, 0.4);
}

#epdSourceFont option {
    background: #1a1a3e;
    color: #e0e0ff;
}

#epdSourceFontSize {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(120, 119, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(15, 15, 30, 0.8);
    color: #e0e0ff;
    transition: all 0.3s;
}

#epdSourceFontSize:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 15px rgba(255, 160, 0, 0.4);
}
