/* 整体主题色和变量定义 */
:root {
    --primary-color: #007aff;
    --primary-hover: #0056b3;
    --bg-color: #f5f7fa;
    --panel-bg: #ffffff;
    --border-color: #e4e7ed;
    --text-primary: #2c3e50;
    --text-secondary: #606266;
    --shadow-light: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 16px 0 rgba(0, 0, 0, 0.08);
    --radius-small: 6px;
    --radius-medium: 8px;
    --radius-large: 12px;
}

/* 基础样式优化 */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden; /* 防止页面整体滚动 */
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* 头部样式优化 */
.header {
    background: var(--panel-bg);
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0 20px;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1920px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    user-select: none;
    -webkit-user-select: none;
}

.logo a {
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
}

.logo h1 {
    font-size: 20px;
    color: #333;
    font-weight: 600;
    background: linear-gradient(120deg, var(--primary-color), #00c6ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.logo-title {
    font-size: 20px;
    margin: 0;
    color: #333;
    font-weight: 600;
    background: linear-gradient(120deg, var(--primary-color), #00c6ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    padding: 4px 8px;
    border-radius: var(--radius-small);
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 500;
    background: rgba(0, 122, 255, 0.1);
}

/* 主要内容区样式 */
.main {
    display: flex;
    height: calc(100vh - 60px);
    margin-top: 60px;
    overflow: hidden;
}

/* 左侧面板 */
.left-panel, .right-panel {
    width: 320px; /* 统一宽度 */
    background: var(--panel-bg);
    border: none;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 修改面板内容容器样式 */
.panel-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 允许内容滚动 */
}

/* 中间预览区 */
.center-panel {
    flex: 1;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
}

.mockup-preview {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mockup-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* 预览区域的背景网格 */
.mockup-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.5;
    z-index: -1;
}

/* 预览区域的加载状态 */
.mockup-preview.loading {
    position: relative;
}

.mockup-preview.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 底部操作栏 */
.actions {
    flex-shrink: 0;
    height: 60px;
    padding: 10px 20px;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

button,
input,
select {
    padding: 8px 12px;
}

button {
    background: #007aff;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.fit-mode {
    margin: 15px 0;
}

.fit-mode h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #666;
}

.fit-buttons {
    display: flex;
    gap: 10px;
}

.fit-btn {
    padding: 8px 15px;
    font-size: 14px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.fit-btn:hover {
    background: #e5e5e5;
}

.fit-btn.active {
    background: #007aff;
    color: white;
    border-color: #007aff;
}

/* 设置区块通用样式 */
.size-settings,
.scale-settings,
.background-settings,
.shadow-settings,
.position-settings {
    background: #FFFFFF;
}

/* 区块标题样式 */
.right-panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    position: relative;
}

/* 修改下拉选择框样式 */
select {
    width: 100%;
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 14px;
    color: var(--text-primary);
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

/* 添加hover效果 */
select:hover {
    border-color: var(--primary-color);
}

/* 添加focus效果 */
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

/* 尺寸输入框组样式 */
.size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F5F7FA;
    padding: 12px;
    border-radius: var(--radius-small);
}

.size-inputs input {
    width: 80px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    text-align: center;
    font-size: 14px;
    background: white;
}

/* 滑块容器样式 */
.scale-slider,
.blur-slider,
.shadow-slider,
.position-slider {
    position: relative;
    padding: 24px 0 8px;
    margin: 4px 0;
}

/* 滑块标签样式 */
.scale-slider label,
.blur-slider label,
.shadow-slider label,
.position-slider label {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 滑块数值气泡样式 */
.scale-slider span,
.blur-slider span,
.shadow-slider span,
.position-slider span {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 1;
    background: none;
    padding: 0;
}

/* 滑块样式优化 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 2px;
    background: #E4E7ED;
    border-radius: 2px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    background: linear-gradient(
        to right,
        var(--primary-color) var(--value-percent, 50%),
        #E4E7ED var(--value-percent, 50%)
    );
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    margin-top: -7px;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-color);
}

/* 颜色选择器样式优化 */
.color-inputs {
    display: grid;
    gap: 16px;
    background: #F5F7FA;
    padding: 12px;
    border-radius: var(--radius-small);
}

.color-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.color-input input[type="color"] {
    width: 48px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 2px;
    background: white;
}

/* 阴影控制样式优化 */
.shadow-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.shadow-options {
    background: #F5F7FA;
    padding: 16px;
    border-radius: var(--radius-small);
    margin-top: 16px;
    transition: all 0.3s ease;
    opacity: 1;
    max-height: 500px; /* 足够大的高度以容纳内容 */
    overflow: hidden;
}

.shadow-options.hidden {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
}

/* 阴影颜色选择器样式优化 */
.shadow-color {
    margin-top: 16px;
    background: #FFFFFF;
    padding: 12px;
    border-radius: var(--radius-small);
    border: 1px solid var(--border-color);
}

.shadow-color label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.shadow-color input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 2px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shadow-color input[type="color"]:hover {
    border-color: var(--primary-color);
}

/* 开关按钮样式优化 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E4E7ED;
    transition: .3s;
    border-radius: 20px;
}

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

input:checked + .slider {
    background-color: var(--primary-color);
}

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

/* 导出按钮样式 */
#download-btn {
    width: 100%;
    height: 44px;
    background: var(--primary-color);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: all 0.2s ease;
}

#download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

/* 移除全局滚动条样式 */
* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    display: none;
}

/* 样机选择样式 */
.mockup-select {
    margin-top: 15px;
}

.mockup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 颜色选择按钮样式 */
.mockup-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    margin-bottom: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 13px;
}

.mockup-btn .color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.mockup-btn:hover {
    background: #f5f7fa;
    border-color: var(--primary-color);
}

.mockup-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mockup-btn.active .color-dot {
    border-color: rgba(255, 255, 255, 0.3);
}

.device-list, .mockup-list {
    margin-top: 12px;
}

.mockup-select h3 {
    font-size: 14px;
}

/* 位置调节样式 */
.position-sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.position-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
}

.position-slider label {
    min-width: 80px;
    font-size: 14px;
    color: #666;
}

.position-slider input[type="range"] {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

.position-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #007aff;
    border-radius: 50%;
    cursor: pointer;
}

.position-slider span {
    min-width: 48px;
    color: #666;
    font-size: 14px;
}

/* 设备分组样式 */
.device-group {
    display: none;
}

.device-group.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* 朝向选择样式 */
.orientation-select {
    margin-top: 20px;
}

.orientation-list {
    display: flex;
    gap: 8px;
}

.orientation-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.orientation-btn:hover {
    background: #f5f7fa;
    border-color: var(--primary-color);
}

.orientation-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 设备类型 Tab 样式 */
.device-tabs {
    height: 100%;
    display: flex;
    gap: 2px;
    background: var(--bg-color);
    padding: 4px;
    border-radius: var(--radius-small);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.device-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    border-radius: var(--radius-small);
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}

.device-tab::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: calc(100% - 16px);
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
    transition: transform 0.3s;
}

.device-tab:hover {
    color: var(--primary-color);
}

.device-tab.active {
    color: var(--primary-color);
    font-weight: 500;
}

.device-tab.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* 添加左右渐变遮罩 */
.device-tabs-container {
    flex-shrink: 0; /* 防止压缩 */
    margin-bottom: 12px;
    height: 44px; /* 固定 tab 高度 */
}

.device-tabs-container::before,
.device-tabs-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.device-tabs-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color), transparent);
}

.device-tabs-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color), transparent);
}

.device-tabs-container.show-left-shadow::before {
    opacity: 1;
}

.device-tabs-container.show-right-shadow::after {
    opacity: 1;
}

/* 设备列表容器 */
.device-list-container {
    flex: 1;
    overflow-y: auto;
   padding-top: 10px;
    padding-bottom:50px; /* 添加底部内边距 */
}

/* 设备列表样式 */
.device-group {
    display: none;
}

.device-group.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* 设备按钮样式 */
.device-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.device-btn:last-child {
    margin-bottom: 0;  /* 移除最后一个按钮的下边距 */
}

/* 左侧面板布局 */
.left-panel {
    height: 100vh;
}

.left-panel .panel-content {
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止整个侧栏滚动 */
}

/* 上传区域样式优化 */
.upload-section {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f6f8fb, #f0f4f8);
    border-radius: var(--radius-medium);
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 预览图列表样式 */
.preview-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0;
    margin-bottom: 8px;
    min-height: 80px;
}

.preview-item,
.upload-placeholder {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.preview-item:hover,
.upload-placeholder:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 删除按钮 */
.preview-item .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    z-index: 2;
}

.preview-item:hover .delete-btn {
    opacity: 1;
}

/* 上传按钮样式 */
.upload-placeholder-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.upload-placeholder svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    opacity: 0.8;
}

.upload-placeholder p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

#wallpaper-upload {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* 大预览图样式 */
.preview {
    display: none; /* 隐藏大预览图 */
}

/* 当前选中项样式 */
.preview-item.active {
    border: 2px solid var(--primary-color);
}

/* 设备列表样式 */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.device-btn:hover {
    background: #f5f7fa;
    border-color: var(--primary-color);
}

.device-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 标题样式 */
h2 {
    margin-bottom: 12px;
    font-size: 16px;
}

/* 设备选择区域 */
.device-select {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 允许内容收缩 */
}

/* 设备列表区域 */
.device-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 允许内容收缩 */
}

/* tabs 固定高度 */
.device-tabs-container {
    flex-shrink: 0;
}

/* 列表容器 */
.device-list-container {
    flex: 1;
    overflow-y: auto;
}

/* 进度条样式 */
.generation-progress {
  margin: 16px 0;
  display: none;
}

.generation-progress.active {
  display: block;
}

.generation-progress progress {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 8px;
}

#progress-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 操作按钮样式 */
.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all 0.2s;
}

.preview {
    width: 100%;
    height: 200px;  /* 设置固定高度 */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-small);
    border: 1px dashed var(--border-color);
    overflow: hidden;
}

#wallpaper-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 空预览状态样式 */
.empty-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-color), #f8f9fa);
    border-radius: var(--radius-medium);
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.empty-preview.dragover {
    background: linear-gradient(135deg, var(--bg-color), #f0f4ff);
    transform: scale(0.99);
}

.empty-preview-content {
    text-align: center;
    padding: 32px;
    max-width: 400px;
    pointer-events: none; /* 让点击事件穿透到父元素 */
}

.empty-preview svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-secondary);
    margin-bottom: 16px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.empty-preview:hover svg {
    transform: translateY(-2px);
}

.empty-preview h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0 0 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    user-select: none;
}

.empty-preview p {
    color: var(--text-secondary);
    margin: 0 0 32px;
    line-height: 1.6;
    font-size: 15px;
    opacity: 0.8;
    user-select: none;
}

.empty-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: left;
    background: rgba(255, 255, 255, 0.5);
    padding: 16px 24px;
    border-radius: var(--radius-small);
    backdrop-filter: blur(10px);
    user-select: none;
    pointer-events: none;
}

.empty-preview li {
    position: relative;
    padding-left: 24px;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.85;
}

.empty-preview li:last-child {
    margin-bottom: 0;
}

/* 当有预览图时隐藏空状态 */
#mockup-canvas:not(:empty) ~ .empty-preview {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* 侧栏切换按钮 */
.sidebar-toggle {
  display: none;
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  cursor: pointer;
  transition: all 0.3s ease;
}

.left-toggle {
  bottom: 20px;
  left: 20px;
}

.right-toggle {
  bottom: 20px;
  right: 20px;
}

.sidebar-toggle:hover {
  transform: scale(1.1);
}

/* 移动端侧栏样式 */
@media (max-width: 768px) {
  .main {
    position: relative;
    padding-bottom: 60px; /* 为底栏留出空间 */
  }
  
  .left-panel,
  .right-panel {
    position: fixed;
    top: 60px;
    bottom: 60px; /* 修改底部位置，避免被底栏遮挡 */
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
  }

  .right-panel {
    right: 0;
    transform: translateX(100%);
  }

  .left-panel.active,
  .right-panel.active {
    transform: translateX(0);
  }

  /* 底栏样式 */
  .bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--panel-bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 99;
    padding: 0 16px;
    display: block !important; /* 强制显示底栏 */
  }

  .bottom-bar-content {
    max-width: 600px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .bottom-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    flex: 1;
  }

  .bottom-bar-btn svg {
    width: 24px;
    height: 24px;
  }

  .bottom-bar-btn span {
    font-size: 12px;
  }

  .bottom-bar-btn:hover {
    color: var(--primary-color);
  }

  .bottom-bar-btn.active {
    color: var(--primary-color);
  }

  /* 添加遮罩层 */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* 调整中间预览区域 */
  .center-panel {
    width: 100%;
    margin: 0;
  }
}

/* 默认隐藏底栏 */
.bottom-bar {
  display: none;
}

/* 提示框样式 */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 18px;
  height: 18px;
}

.toast.success {
  background: rgba(40, 167, 69, 0.9);
}

.toast.error {
  background: rgba(220, 53, 69, 0.9);
}

.toast.warning {
  background: rgba(255, 193, 7, 0.9);
}

.toast.info {
  background: rgba(0, 122, 255, 0.9);
}

/* 有图片时隐藏占位符 */
#wallpaper-preview[src]:not([src=""]) ~ .upload-placeholder {
  opacity: 0;
  pointer-events: none;
}

/* 上传区域标题样式 */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-tip {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* 添加加载状态样式 */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 添加加载提示样式 */
.loading-tip {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.loading-bubble {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-preview .upload-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary-color);
  color: white;
  border-radius: 50px;
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 32px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.empty-preview .upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3);
}
