* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Noto Sans SC', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e6e6e6;
    min-height: 100vh;
    padding: 10px;
}

.container {
    display: flex;
    flex-direction: column;
    max-width: 1920px;
    margin: 0 auto;
    gap: 15px;
    height: calc(100vh - 20px);
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.header h1 {
    white-space: nowrap;
    font-size: 22px;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

@media (min-width: 992px) {
    .main-content {
        flex-direction: row;
    }

    .header {
        flex-direction: row;
        justify-content: space-between;
    }

    .header h1 {
        margin-bottom: 0;
    }
}

/* 左侧工具栏 */
.toolbar {
    flex: 0 0 auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 400px;
    /* 隐藏滚动条但保留滚动功能 */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* 隐藏WebKit浏览器的滚动条 */
.toolbar::-webkit-scrollbar {
    display: none;
}

@media (min-width: 992px) {
    .toolbar {
        width: 340px;
        max-height: none;
    }
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #6a89cc;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 形状下拉按钮样式 */
.shape-toggle-btn {
    background: none;
    border: none;
    color: #6a89cc;
    cursor: pointer;
    font-size: 12px;
    transition: transform 0.3s ease;
    padding: 2px;
    border-radius: 3px;
}

.shape-toggle-btn:hover {
    background: rgba(106, 137, 204, 0.2);
}

.shape-toggle-btn.active {
    transform: rotate(180deg);
}

/* 形状容器样式 */
.shapes-container {
    max-height: 150px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.shapes-container.expanded {
    max-height: 300px;
}

/* 所有形状元素样式 */
.shapes-container .material {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
}

/* 默认隐藏额外形状 */
.shapes-container .shape-more {
    opacity: 0;
    transform: translateY(10px);
    display: none;
}

/* 展开时显示所有形状 */
.shapes-container.expanded .shape-more {
    opacity: 1;
    transform: translateY(0);
    display: flex;
}

/* 额外形状样式 */
.shape-more {
    transition-delay: 0.05s;
}

.shapes-container.expanded .shape-more:nth-child(7) {
    transition-delay: 0.05s;
}

.shapes-container.expanded .shape-more:nth-child(8) {
    transition-delay: 0.1s;
}

.shapes-container.expanded .shape-more:nth-child(9) {
    transition-delay: 0.15s;
}

.shapes-container.expanded .shape-more:nth-child(10) {
    transition-delay: 0.2s;
}

.shapes-container.expanded .shape-more:nth-child(11) {
    transition-delay: 0.25s;
}

.shapes-container.expanded .shape-more:nth-child(12) {
    transition-delay: 0.3s;
}

.shapes-container.expanded .shape-more:nth-child(13) {
    transition-delay: 0.35s;
}

.shapes-container.expanded .shape-more:nth-child(14) {
    transition-delay: 0.4s;
}

.shapes-container.expanded .shape-more:nth-child(15) {
    transition-delay: 0.45s;
}

.shapes-container.expanded .shape-more:nth-child(16) {
    transition-delay: 0.5s;
}

.section-title i {
    font-size: 12px;
}

/* 模板切换按钮样式 */
.template-toggle-btn {
    background: none;
    border: none;
    color: #6a89cc;
    cursor: pointer;
    font-size: 12px;
    transition: transform 0.3s ease;
    padding: 2px;
    border-radius: 3px;
}

.template-toggle-btn:hover {
    background: rgba(106, 137, 204, 0.2);
}

.template-toggle-btn.active {
    transform: rotate(180deg);
}

/* 属性面板切换按钮样式 */
.toggle-btn {
    background: none;
    border: none;
    color: #6a89cc;
    cursor: pointer;
    font-size: 12px;
    transition: transform 0.3s ease;
    padding: 2px;
    border-radius: 3px;
}

.toggle-btn:hover {
    background: rgba(106, 137, 204, 0.2);
}

.toggle-btn.active {
    transform: rotate(180deg);
}

/* 可折叠容器样式 */
.collapsible-container {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-container.collapsed {
    max-height: 70px;
}

/* 辅助框设置折叠样式 - 折叠时显示启用开关 */
.guide-box-properties.collapsible-container {
    max-height: 300px;
}

.guide-box-properties.collapsible-container.collapsed {
    max-height: 30px;
}

.guide-box-details {
    transition: opacity 0.3s ease;
}

/* 子标题样式 */
.section-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: #8a9ccc;
    margin-bottom: 8px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 模板容器样式 */
.templates-container {
    max-height: 78px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.templates-container.expanded {
    max-height: 420px;
}

/* 模板区域 */
.templates {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.template {
    aspect-ratio: 2/1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px;
}

.template:hover {
    background: rgba(106, 137, 204, 0.2);
    transform: translateY(-2px);
}

.template.selected {
    background: rgba(106, 137, 204, 0.3);
    border-color: #6a89cc;
    box-shadow: 0 0 10px rgba(106, 137, 204, 0.5);
}

.template-label {
    font-size: 10px;
    margin-top: 3px;
    color: #aaa;
}

.template-grid {
    display: grid;
    width: 100%;
    height: 70%;
    gap: 1px;
    padding: 2px;
}

.grid-cell {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
}

.template-2x1 .template-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(1, 1fr);
}

.template-2x1-capsule .template-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(1, 1fr);
}

.template-2x2 .template-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.template-2x3 .template-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.template-4x1 .template-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(1, 1fr);
}

.template-4x1-capsule .template-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(1, 1fr);
}

.template-4x2 .template-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.template-4x3 .template-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

/* 素材库分类 */
.materials-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.materials-category {
    margin-bottom: 5px;
}

.materials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.material {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.material:hover {
    background: rgba(106, 137, 204, 0.2);
}

.material.selected {
    background: rgba(106, 137, 204, 0.3);
    border-color: #6a89cc;
    box-shadow: 0 0 5px rgba(106, 137, 204, 0.5);
}

.material i {
    font-size: 18px;
    color: #6a89cc;
}

.material-upload {
    position: relative;
    overflow: hidden;
}

.material-upload input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* SVG形状预览 */
.shape-preview {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-preview svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 导入的素材列表 */
.uploaded-materials-container {
    width: 100%;
    display: none;
}

.uploaded-materials-container.has-content {
    display: block;
}

.uploaded-materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.uploaded-materials-header i {
    transition: transform 0.3s ease;
}

.uploaded-materials-header.collapsed i {
    transform: rotate(180deg);
}

.uploaded-materials-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.uploaded-materials-list.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.uploaded-material {
    width: 100%;
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.uploaded-material:hover {
    background: rgba(106, 137, 204, 0.2);
}

.uploaded-material.selected {
    background: rgba(106, 137, 204, 0.3);
    border-color: #6a89cc;
    box-shadow: 0 0 5px rgba(106, 137, 204, 0.5);
}

.uploaded-material img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.uploaded-material-name {
    font-size: 9px;
    margin-top: 3px;
    color: #aaa;
    text-align: center;
    word-break: break-all;
    padding: 0 2px;
    max-width: 100%;
}

.uploaded-material-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(231, 76, 60, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.uploaded-material:hover .uploaded-material-delete {
    opacity: 1;
}

.uploaded-material-delete:hover {
    background: rgba(231, 76, 60, 1);
}

/* 文字素材列表 */
.text-materials-container {
    width: 100%;
    display: none;
}

.text-materials-container.has-content {
    display: block;
}

.text-materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.text-materials-header i {
    transition: transform 0.3s ease;
}

.text-materials-header.collapsed i {
    transform: rotate(180deg);
}

.text-materials-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.text-materials-list.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.text-material {
    width: 100%;
    min-height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    padding: 8px;
}

.text-material:hover {
    background: rgba(106, 137, 204, 0.2);
}

.text-material.selected {
    background: rgba(106, 137, 204, 0.3);
    border-color: #6a89cc;
    box-shadow: 0 0 5px rgba(106, 137, 204, 0.5);
}

.text-material-content {
    font-size: 12px;
    color: white;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    max-height: 60px;
    overflow: hidden;
}

.text-material-name {
    font-size: 9px;
    margin-top: 3px;
    color: #aaa;
    text-align: center;
}

.text-material-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: rgba(231, 76, 60, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.text-material:hover .text-material-delete {
    opacity: 1;
}

.text-material-delete:hover {
    background: rgba(231, 76, 60, 1);
}

/* 已添加模块列表 */
.module-materials-container {
    width: 100%;
    display: none;
}

.module-materials-container.has-content {
    display: block;
}

.module-materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.module-materials-header i {
    transition: transform 0.3s ease;
}

.module-materials-header.collapsed i {
    transform: rotate(180deg);
}

.module-materials-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.module-materials-list.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

/* 形状元素列表 */
.shape-materials-container {
    width: 100%;
    display: none;
}

.shape-materials-container.has-content {
    display: block;
}

.shape-materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.shape-materials-header i {
    transition: transform 0.3s ease;
}

.shape-materials-header.collapsed i {
    transform: rotate(180deg);
}

.shape-materials-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.shape-materials-list.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.shape-material {
    width: 100%;
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.shape-material:hover {
    background: rgba(106, 137, 204, 0.2);
}

.shape-material.selected {
    background: rgba(106, 137, 204, 0.3);
    border-color: #6a89cc;
    box-shadow: 0 0 5px rgba(106, 137, 204, 0.5);
}

.shape-material-name {
    font-size: 9px;
    margin-top: 3px;
    color: #aaa;
    text-align: center;
}

.shape-material-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(231, 76, 60, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.shape-material:hover .shape-material-delete {
    opacity: 1;
}

.shape-material-delete:hover {
    background: rgba(231, 76, 60, 1);
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
}

.color-option {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: white;
    box-shadow: 0 0 5px white;
}

/* 渐变背景编辑器 */
.gradient-editor {
    margin-top: 2px;
}

.gradient-types {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.gradient-type {
    padding: 6px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.gradient-type:hover {
    background: rgba(106, 137, 204, 0.2);
}

.gradient-type.selected {
    background: rgba(106, 137, 204, 0.4);
    border-color: #6a89cc;
    color: white;
}

.gradient-stops-container {
    margin-bottom: 10px;
}

.gradient-stop {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.stop-position {
    width: 40px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    color: white;
    font-size: 11px;
    text-align: center;
}

.stop-color {
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background: transparent;
}

.stop-color-value {
    width: 70px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    color: white;
    font-size: 11px;
    text-align: center;
}

.stop-remove {
    width: 14px;
    height: 14px;
    background: rgba(182, 181, 180, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.stop-remove:hover {
    background: rgba(231, 76, 60, 1);
}

.gradient-preview {
    width: 100%;
    height: 50px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(to right, #ffffff, #000000);
}

.gradient-controls {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.gradient-btn-small {
    padding: 6px 6px;
    background: rgba(106, 137, 204, 0.2);
    border: 1px solid rgba(106, 137, 204, 0.5);
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    flex: 1;
}

.gradient-btn-small:hover {
    background: rgba(106, 137, 204, 0.3);
}

/* 导入背景按钮 */
.background-upload {
    position: relative;
    width: 100%;
}

.background-upload-btn {
    width: 100%;
    padding: 6px 6px;
    background: rgba(106, 137, 204, 0.2);
    border: 1px solid rgba(106, 137, 204, 0.5);
    border-radius: 5px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.background-upload-btn:hover {
    background: rgba(106, 137, 204, 0.3);
}

.background-upload input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 中间预览区域 */
.preview-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.preview-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

@media (min-width: 768px) {
    .preview-header {
        flex-direction: row;
        justify-content: space-between;
    }
}

.preview-area {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    position: relative;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.widget-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    background: #FFFFFF;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    touch-action: none;
    user-select: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Widget选中状态 */
.widget-container.selected {
    outline: 2px dashed #6a89cc;
    outline-offset: -1px;
}

.widget-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.widget-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

/* 可拖拽的元素样式 */
.draggable-element {
    position: absolute;
    cursor: move;
    z-index: 10;
    user-select: none;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 修改选中状态为打点虚线边框，覆盖整个元素 */
.draggable-element.selected {
    outline: 2px dashed #6a89cc;
    outline-offset: -1px;
}

.draggable-element img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* 文字元素样式 */
.text-element {
    position: absolute;
    cursor: move;
    z-index: 10;
    user-select: none;
    touch-action: none;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-element.selected {
    outline: 2px dashed #6a89cc;
    outline-offset: -1px;
}

.text-element-content {
    pointer-events: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 形状元素样式 */
.shape-element {
    position: absolute;
    cursor: move;
    z-index: 10;
    user-select: none;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shape-element.selected {
    outline: 2px dashed #6a89cc;
    outline-offset: -1px;
}

.shape-inner {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shape-rectangle-element {
    background: #6a89cc;
    border-radius: 5px;
}

.shape-circle-element {
    background: #6a89cc;
    border-radius: 50%;
}

.shape-triangle-element {
    width: 0;
    height: 0;
    border-left: 50% solid transparent;
    border-right: 50% solid transparent;
    border-bottom: 100% solid #6a89cc;
    background: transparent !important;
}

/* 特殊模块样式 */
.module-element {
    position: absolute;
    cursor: move;
    z-index: 10;
    user-select: none;
    touch-action: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-element.selected,
.analog-clock-element.selected,
.weather-icon-element.selected,
.temperature-element.selected,
.hour-element.selected,
.minute-element.selected {
    outline: 2px dashed #6a89cc;
    outline-offset: -1px;
}

.module-element-content {
    pointer-events: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-title {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.module-content {
    font-size: 14px;
    color: #555;
}

/* 指针时钟属性面板样式 */
.clock-image-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.clock-image-container {
    display: flex;
    flex: 1;
    justify-content: flex-end;
}

.clock-image-preview {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clock-image-preview:hover {
    border-color: #6a89cc;
    background-color: #f0f4ff;
}

.clock-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.clock-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clock-image-preview:hover .clock-image-overlay {
    opacity: 1;
}

.clock-image-overlay i {
    color: white;
    font-size: 18px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #6a89cc;
}

input:focus+.slider {
    box-shadow: 0 0 1px #6a89cc;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* 尺寸控制点样式 */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #6a89cc;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 20;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: auto;
}

.selected .resize-handle {
    opacity: 1;
}

.resize-handle:hover {
    background: #4a69bd;
    transform: scale(1.2);
}

/* 八个控制点位置 */
.resize-handle.top-left {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.top-center {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

.resize-handle.top-right {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.middle-right {
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    cursor: e-resize;
}

.resize-handle.bottom-right {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.resize-handle.bottom-center {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
}

.resize-handle.bottom-left {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.middle-left {
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    cursor: w-resize;
}

/* 相册元素样式 */
.photo-element {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    z-index: 1;
}

.photo-element .photo-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.photo-element.selected {
    z-index: 10;
}

.photo-element.selected .photo-container {
    overflow: visible;
}

/* 相册图片容器样式 */
[id^="photo_img_container_"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 辅助线 - 现在在widget容器内部 */
.guide-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.guide-line {
    position: absolute;
    background-color: rgba(136, 136, 136, 0.5);
}

.guide-line.vertical {
    width: 1px;
    height: 100%;
}

.guide-line.horizontal {
    width: 100%;
    height: 1px;
}

/* 缩放控制 */
.zoom-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 20;
}

/* 右侧属性面板 */
.properties {
    flex: 0 0 auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 500px;
    /* 隐藏滚动条但保留滚动功能 */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* 隐藏WebKit浏览器的滚动条 */
.properties::-webkit-scrollbar {
    display: none;
}

@media (min-width: 992px) {
    .properties {
        width: 340px;
        max-height: none;
    }
}

.property-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.property-label {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
    margin-right: 10px;
}

.property-value {
    font-size: 13px;
    color: white;
}

input[type="range"] {
    width: 100%;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    font-size: 13px;
    text-align: center;
}

select {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    font-size: 13px;
}

select option {
    color: black;
    background: white;
}

input[type="color"] {
    width: 35px;
    height: 25px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background: transparent;
}

/* 按钮样式 */
.btn {
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #5a0cb9, #1c68e8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 117, 252, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
}

/* 导出配置模态框 */
.export-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.export-modal-content {
    background: #1a1a2e;
    border-radius: 10px;
    padding: 20px;
    width: 50vw;
    max-width: 90vw;
    height: 66.6vh;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.export-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.export-modal-body {
    display: flex;
    flex: 1;
    gap: 20px;
    overflow: hidden;
}

.export-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;

}

.export-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 20px;
}

.export-close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.export-format {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    overflow-y: auto;
    flex: 1;
    margin-top: 10px;
    line-height: 1.4;
    max-height: calc(66.6vh - 150px);
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 10px 0;
}

.export-option-group {
    width: 100%;
}

.dropdown-select {
    padding: 6px 10px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 13px;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20fill%3D%22%23aaa%22%20d%3D%22M4%209l4%204%204-4%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .export-modal-content {
        width: 70vw;
    }
}

@media (max-width: 768px) {
    .export-modal-content {
        width: 90vw;
        height: 80vh;
    }

    .export-modal-body {
        flex-direction: column;
    }

    .export-right {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-left: 0;
        padding-top: 20px;
        margin-top: 20px;
    }

    .export-format {
        max-height: 300px;
    }
}

/* 移动端优化 */
@media (max-width: 480px) {
    .header-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 图层控制按钮 */
.layer-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* 网格颜色选择器 */
.grid-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.grid-color-option {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.grid-color-option:hover {
    transform: scale(1.1);
}

.grid-color-option.selected {
    border-color: white;
    box-shadow: 0 0 3px white;
}

/* 网格属性面板 */
.grid-properties {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* JSON高亮样式 */
.export-format .string {
    color: #78c06e;
}

.export-format .number {
    color: #6a9cf5;
}

.export-format .boolean {
    color: #ff6b6b;
}

.export-format .null {
    color: #bd93f9;
}

.export-format .key {
    color: #ffb86c;
}

/* 右键菜单样式 */
.context-menu {
    display: none;
    position: absolute;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    min-width: 120px;
    overflow: hidden;
}

.context-menu-item {
    padding: 8px 15px;
    color: #e6e6e6;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background: rgba(106, 137, 204, 0.3);
}

.context-menu-item:active {
    background: rgba(106, 137, 204, 0.5);
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.context-menu-item i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

/* 对齐按钮样式 */
.alignment-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    transition: all 0.2s;
}

.alignment-btn:hover {
    background: #e9e9e9;
    border-color: #ccc;
}

.alignment-btn.active {
    background: #6a89cc;
    color: white;
    border-color: #6a89cc;
}

.alignment-btn-group {
    display: flex;
    gap: 2px;
}

.alignment-controls {
    display: flex;
    gap: 5px;
    flex-grow: 1;
}

.property-row .alignment-controls {
    margin-left: 10px;
}

/* 素材库模态框样式 */
.material-library-modal {
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
}

.material-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

.material-modal-title {
    margin: 0;
    font-size: 18px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.material-modal-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

/* 加载状态 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #6a89cc;
    font-size: 16px;
}

.loading-spinner i {
    font-size: 32px;
    margin-bottom: 15px;
}

/* 错误状态 */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #e74c3c;
    text-align: center;
}

.error-message i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #e74c3c;
}

.error-message p {
    margin-bottom: 20px;
    font-size: 16px;
}

.retry-btn {
    padding: 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #2980b9;
}

/* 空状态 */
.no-materials {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #999;
}

.no-materials i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ddd;
}

.no-materials p {
    font-size: 16px;
}

/* 分类选项卡样式 */
.material-category-tabs {
    display: flex;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.category-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: -1px;
}

.category-tab.active {
    color: #1890ff;
    font-weight: 500;
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 2px;
    background-color: #1890ff;
}

/* 素材库网格 */
.material-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    /* 网格项宽度 */
    gap: 12px;
    /* 间距 */
    padding: 8px;
}

.material-library-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    /* 为tooltip定位做准备 */
}

.material-library-item:hover {
    transform: translateY(-3px);
    /* 减小悬停上移距离 */
}

.material-library-thumbnail {
    width: 100%;
    height: 80px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    padding: 5px;
    /* 添加内边距 */
}

.material-library-thumbnail img {
    max-width: 90%;
    /* 图片占容器90% */
    max-height: 90%;
    /* 图片占容器90% */
    object-fit: contain;
    transition: transform 0.3s ease;
}

.material-library-thumbnail:hover img {
    transform: scale(1.03);
    /* 减小缩放比例 */
}

/* 素材名称样式 - 默认隐藏，鼠标悬停时显示 */
.material-library-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 4px;
    /* 减小内边距 */
    font-size: 11px;
    /* 减小字体大小 */
    color: white;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(41, 41, 41, 0.3);
    /* 半透明黑色背景 */
    backdrop-filter: blur(4px);
    border-radius: 0 0 10px 10px;
    opacity: 0;
    /* 默认透明 */
    visibility: hidden;
    /* 默认隐藏 */
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    pointer-events: none;
    /* 防止干扰鼠标事件 */
}

/* 鼠标悬停时显示名称 */
.material-library-item:hover .material-library-name {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .material-library-modal {
        width: 95%;
        height: 90vh;
    }

    .material-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        /* 移动端更小的网格 */
        gap: 8px;
    }

    .material-library-thumbnail {
        height: 90px;
        /* 移动端更小的缩略图 */
    }

    .material-preview-modal {
        width: 95%;
    }
}

/* 自适应开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #6A89CC;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.text-edit-box {
    position: absolute;
    z-index: 10000;
    background-color: white;
    border: 2px solid #0066ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 5px;
    box-sizing: border-box;
}

.text-edit-input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: center;
    background-color: transparent;
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 七天日历模块样式 */
.seven-week-row {
    display: flex;
    width: 100%;
    height: 48%;
    align-items: center;
}

.weekdays-row {
    margin-bottom: 2%;
}

.dates-row {
    margin-top: 2%;
}

.seven-week-cell {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}

.weekday-cell {
    font-weight: 500;
}

.date-cell {
    font-weight: 400;
}

.module-content-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

/* 文字编辑框样式 */
.text-edit-box {
    position: absolute;
    z-index: 10000;
    background-color: white;
    border: 2px solid #0066ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 5px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-edit-input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: inherit;
    vertical-align: middle;
    background-color: transparent;
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 框选和多选样式 */
.box-selection {
    position: absolute;
    border: 2px dashed #0066ff;
    background-color: rgba(0, 102, 255, 0.1);
    z-index: 9999;
    pointer-events: none;
}

.multi-selected {
    border: 2px dashed #0066ff !important;
    box-shadow: 0 0 0 1px rgba(0, 102, 255, 0.5);
}

.draggable-element.multi-selected::after,
.text-element.multi-selected::after,
.shape-element.multi-selected::after,
.module-element.multi-selected::after,
.analog-clock-element.multi-selected::after,
.weather-icon-element.multi-selected::after,
.temperature-element.multi-selected::after,
.hour-element.multi-selected::after,
.minute-element.multi-selected::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px dashed #0066ff;
    pointer-events: none;
}

/* 帮助模态框样式 */
.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.help-modal-content {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 20px;
    width: 61.5vw;
    height: 79vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.help-modal-title {
    margin: 0;
    font-size: 18px;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-modal-body {
    display: flex;
    gap: 20px;
    overflow: auto;
    /* 允许滚动 */
    flex-wrap: wrap;
    /* 自动换行 */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.help-modal-body::-webkit-scrollbar {
    display: none;
}

.help-modal-body img {
    max-width: 100%;
    /* 确保图片不会超出容器宽度 */
    height: auto;
    /* 保持宽高比 */
    border-radius: 10px;
}

.help-close-modal {
    background: none;
    border: none;
    color: black;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    min-width: 300px;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #4CAF50;
}

.notification-error {
    border-left: 4px solid #F44336;
}

.notification-warning {
    border-left: 4px solid #FF9800;
}

.notification-info {
    border-left: 4px solid #2196F3;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    font-size: 20px;
}

.notification-success .notification-content i {
    color: #4CAF50;
}

.notification-error .notification-content i {
    color: #F44336;
}

.notification-warning .notification-content i {
    color: #FF9800;
}

.notification-info .notification-content i {
    color: #2196F3;
}

.notification-content span {
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

/* 云端widget样式 */
.widget-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

.import-zip-btn {
    padding: 6px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.import-zip-btn:hover {
    background: rgba(106, 137, 204, 0.2);
}

.import-zip-btn.selected {
    background: rgba(106, 137, 204, 0.4);
    border-color: #6a89cc;
    color: white;
}

.cloud-widgets-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cloud-widgets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    flex: 1;
    max-height: 100%;
    overflow-y: auto;
    padding: 10px;
    align-content: flex-start;
}

.cloud-widget-item {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

/* 居中显示的提示信息 */
.cloud-widget-empty,
.import-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
    gap: 10px;
}

.cloud-widget-empty .cloud-widget-empty-p1 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.cloud-widget-empty .cloud-widget-empty-p2 {
    position: absolute;
    top: 53%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.import-loading i {
    font-size: 24px;
    color: #6a89cc;
}

.cloud-widget-item:hover {
    background: #eef5ff;
    border-color: #6a89cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(106, 137, 204, 0.2);
}

.cloud-widget-preview {
    width: 100%;
    height: 80px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cloud-widget-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cloud-widget-info {
    text-align: center;
}

.cloud-widget-name {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cloud-widget-date {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 云端Widget删除按钮样式 */
.cloud-widget-preview-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.cloud-widget-preview {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
}

.cloud-widget-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cloud-widget-preview:hover img {
    transform: scale(1.05);
}

.cloud-widget-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    z-index: 10;
}

.cloud-widget-delete-btn:hover {
    background-color: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.cloud-widget-delete-btn i {
    font-size: 12px;
}

.cloud-widget-item:hover .cloud-widget-delete-btn {
    opacity: 1;
}

/* 加载状态 */
.cloud-widget-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: #666;
}

.cloud-widget-loading i {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Toast消息 */
.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    background-color: #333;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast-success {
    background-color: #4CAF50;
}

.toast-error {
    background-color: #f44336;
}

.toast-info {
    background-color: #2196F3;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    margin-left: 10px;
    padding: 0;
    opacity: 0.8;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 用户信息 */
.cloud-widget-user {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

#centerGuideLines {
    pointer-events: none;
    z-index: 1000;
}

.center-guide-line {
    position: absolute;
    background-color: #ff4444;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.center-guide-line.horizontal {
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.center-guide-line.vertical {
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.center-guide-line.active {
    opacity: 0.8;
    display: block !important;
}

.preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.preview-loading-spinner {
    text-align: center;
}

.preview-loading-spinner i {
    font-size: 2rem;
    color: #6a89cc;
    margin-bottom: 10px;
}

.preview-loading-spinner p {
    color: #666;
    font-size: 0.9rem;
}

/* AI对话框样式 */
.ai-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.ai-dialog.show {
    display: flex;
}

.ai-dialog-content {
    background: #1a1a2e;
    border-radius: 10px;
    padding: 20px;
    width: 800px;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

/* AI对话框加载动画 */
.ai-message .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(106, 137, 204, 0.3);
    border-radius: 50%;
    border-top-color: #6a89cc;
    animation: spin 1s ease-in-out infinite;
    margin: 10px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ai-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-dialog-header-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-dialog-clear {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.ai-dialog-clear:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-dialog-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-dialog-header h3::before {
    content: "\f544";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #6a89cc;
}

.ai-dialog-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.ai-dialog-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-dialog-body {
    flex: 1;
    overflow: hidden;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    display: flex;
    gap: 15px;
}

/* 隐藏滚动条但保持滚动功能 */
.ai-dialog-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.ai-dialog-body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ai-message {
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.ai-message.user {
    background: #6a89cc;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.ai-message.ai {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.ai-dialog-footer {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.ai-footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.ai-input {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
}

.ai-input:focus {
    border-color: #6a89cc;
    background: rgba(255, 255, 255, 0.15);
}

.ai-input::placeholder {
    color: rgba(102, 102, 102, 0.6);
}

.ai-send-btn {
    width: 36px;
    height: 36px;
    background: #6a89cc;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-send-btn:hover {
    background: #4a69bd;
    transform: scale(1.05);
}

.ai-send-btn i {
    font-size: 16px;
}

/* AI输入容器样式 */
.ai-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-height: 40px;
    padding: 8px 0;
    justify-content: center;
}

/* AI上传按钮样式 */
.ai-upload-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #6a89cc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-upload-btn:hover {
    background: rgba(106, 137, 204, 0.2);
    border-color: #6a89cc;
    transform: scale(1.05);
}

.ai-upload-btn i {
    font-size: 16px;
}

/* 调整输入框样式，使其与上传按钮对齐 */
.ai-input {
    flex: 1;
    border-radius: 20px;
    padding: 8px 15px;
    min-height: 40px;
    max-height: 100px;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
}

/* AI对话框头部左侧容器 */
.ai-dialog-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* AI模板按钮样式 */
.ai-template-btn {
    padding: 6px 12px;
    background: rgba(106, 137, 204, 0.2);
    border: 1px solid rgba(106, 137, 204, 0.5);
    border-radius: 15px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.ai-template-btn:hover {
    background: rgb(106, 137, 204);
    border-color: #6a89cc;
    transform: translateY(-1px);
}

.ai-template-btn i {
    font-size: 12px;
}

/* AI对话框主体容器 */
.ai-dialog-body-container {
    flex: 1;
    display: flex;
    gap: 10px;
    position: relative;
    min-height: 300px;
}

/* 模板列表样式 */
/* AI助手区域样式 */
.ai-assistant-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.ai-assistant-area .ai-dialog-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 10px;
}

/* 消息区域样式 */
.ai-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}