:root {
    --ps-dark-bg: #2d2d2d;
    --ps-light-bg: #3c3c3c;
    --ps-panel-bg: #252526;
    --ps-text: #e0e0e0;
    --ps-text-light: #ffffff;
    --ps-text-dark: #a0a0a0;
    --ps-accent: #0078d7;
    --ps-accent-hover: #0086f0;
    --ps-border: #1e1e1e;
    --ps-border-light: #4d4d4d;
    --ps-toolbar-bg: #333333;
    --ps-danger: #f04747;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--ps-dark-bg);
    color: var(--ps-text);
    font-size: 13px;
    line-height: 1.5;
}

h1 {
    font-size: 18px;
    font-weight: 500;
    color: var(--ps-text-light);
    padding: 12px 16px;
    margin: 0;
    background-color: var(--ps-panel-bg);
    border-bottom: 1px solid var(--ps-border);
}

.action-bar {
    background-color: var(--ps-toolbar-bg);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ps-border);
}

.action-bar > div {
    display: flex;
    gap: 8px;
    align-items: center;
}

.log-entry {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.log-time {
    color: #4CAF50;
    margin-right: 8px;
}

.log-action {
    color: #BBBBBB;
}

.log-details {
    color: #888;
    margin: 4px 0 0 20px;
    font-size: 11px;
    overflow-x: auto;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 3px;
    max-height: 150px;
    overflow-y: auto;
}

button {
    padding: 6px 12px;
    background-color: var(--ps-light-bg);
    color: var(--ps-text);
    border: 1px solid var(--ps-border);
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.1s ease;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: var(--ps-light-bg);
    border-color: var(--ps-border-light);
    color: var(--ps-text-light);
}

button:active {
    background-color: var(--ps-border);
}

button.secondary {
    background-color: var(--ps-accent);
    color: white;
    border-color: var(--ps-accent);
}

button.secondary:hover {
    background-color: var(--ps-accent-hover);
    border-color: var(--ps-accent-hover);
}

button.danger {
    background-color: var(--ps-danger);
    color: white;
    border-color: var(--ps-danger);
}

button.danger:hover {
    background-color: #e03535;
    border-color: #e03535;
}

.main-container {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    height: calc(100vh - 50px);
}

/* 左侧目录树样式 */
.library {
    background-color: var(--ps-panel-bg);
    border-right: 1px solid var(--ps-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.directory-tree {
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.directory-item {
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    user-select: none;
}

.directory-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.directory-item.folder {
    position: relative;
    padding-left: 20px;
}

.directory-item.folder::before {
    content: "▶";
    position: absolute;
    left: 6px;
    top: 6px;
    font-size: 10px;
    transition: transform 0.2s;
}

.directory-item.expanded::before {
    transform: rotate(90deg);
}

.directory-children {
    margin-left: 12px;
    display: none;
}

.directory-item.expanded > .directory-children {
    display: block;
}

/* 图片选择区样式 */
.content-area {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.image-selector-header {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: var(--ps-dark-bg);
    border-bottom: 1px solid var(--ps-border);
}

#backToTree {
    margin-right: 12px;
}

#currentDirectory {
    margin: 0;
    font-size: 14px;
    color: var(--ps-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.image-grid-item {
    background-color: var(--ps-light-bg);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--ps-border);
}

.image-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: var(--ps-accent);
}

.image-grid-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-grid-item-name {
    padding: 6px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 工作区样式 */
.workspace-container {
    background-color: var(--ps-dark-bg);
    position: relative;
    overflow: auto;
}

.workspace {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--ps-dark-bg);
    background-image: 
        linear-gradient(45deg, #333 25%, transparent 25%, transparent 75%, #333 75%, #333),
        linear-gradient(45deg, #333 25%, transparent 25%, transparent 75%, #333 75%, #333);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
}

.workspace-item {
    position: absolute;
    cursor: move;
    background-color: transparent;
    transition: transform 0.1s ease;
}

.workspace-item.selected {
    outline: 2px solid var(--ps-accent);
    box-shadow: 0 0 0 1px var(--ps-dark-bg);
}

.workspace-item img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    pointer-events: none;
}

/* 右侧面板样式 */
.right-panel {
    background-color: var(--ps-panel-bg);
    border-left: 1px solid var(--ps-border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.layers-panel {
    flex: 0 0 auto;
    max-height: 40vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--ps-border);
}

.layers-panel h3 {
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    margin: 0;
    color: var(--ps-text-light);
    background-color: var(--ps-dark-bg);
    border-bottom: 1px solid var(--ps-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
}

#layersList {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.layer-item {
    padding: 6px 12px 6px 24px;
    cursor: pointer;
    position: relative;
    font-size: 12px;
    color: var(--ps-text);
    transition: all 0.1s ease;
}

.layer-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.layer-item.selected {
    background-color: rgba(0, 120, 215, 0.2);
    color: var(--ps-text-light);
}

.layer-item.selected::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--ps-accent);
    border-radius: 2px;
}

.layer-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 控制面板样式 */
.controls-panel {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.controls-panel h3 {
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    margin: 0;
    color: var(--ps-text-light);
    background-color: var(--ps-dark-bg);
    border-bottom: 1px solid var(--ps-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#elementControls {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--ps-text-dark);
}

.control-group input[type="number"],
.control-group input[type="text"],
.control-group input[type="color"],
.control-group select {
    width: 100%;
    padding: 4px 8px;
    background-color: var(--ps-light-bg);
    border: 1px solid var(--ps-border);
    color: var(--ps-text);
    border-radius: 2px;
    font-size: 12px;
    height: 24px;
}

.control-group input[type="range"] {
    width: 100%;
}

/* 浮动控制按钮 */
.floating-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
    background-color: var(--ps-dark-bg);
    border-top: 1px solid var(--ps-border);
}

.floating-controls button {
    width: 100%;
    padding: 6px;
    background-color: var(--ps-light-bg);
    border: 1px solid var(--ps-border);
    color: var(--ps-text);
    border-radius: 2px;
    text-align: center;
}

.floating-controls button:hover {
    background-color: #454545;
    color: var(--ps-text-light);
}

.floating-controls button.danger:hover {
    background-color: var(--ps-danger);
}

/* 输出区域样式 */
.output-area {
    background-color: var(--ps-panel-bg);
    border-top: 1px solid var(--ps-border);
    padding: 8px;
    display: none;
}

.output-tabs {
    display: flex;
    margin-bottom: 8px;
}

.output-tab {
    padding: 6px 12px;
    background-color: transparent;
    border: none;
    color: var(--ps-text);
    font-size: 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.output-tab.active {
    color: var(--ps-text-light);
    border-bottom-color: var(--ps-accent);
}

#output-content {
    background-color: var(--ps-dark-bg);
    border: 1px solid var(--ps-border);
    padding: 8px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    white-space: pre;
    color: var(--ps-text);
    height: 120px;
    overflow: auto;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--ps-dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--ps-light-bg);
    border-radius: 5px;
}

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

/* 文字元素样式 */
.text-item {
    position: absolute;
    cursor: move;
    padding: 4px;
    color: var(--ps-text-light);
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    user-select: none;
    white-space: nowrap;
}

.text-item.selected {
    outline: 2px solid var(--ps-accent);
}

/* 工具提示 */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 4px;
    pointer-events: none;
    opacity: 0.9;
}

.image-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.close-modal:hover {
    color: #495057;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* 缩略图网格样式 */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.thumbnail-item {
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.thumbnail-name {
    padding: 8px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f8f9fa;
}

.image-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* 缩略图网格样式 */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.thumbnail-item {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.thumbnail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #0078d7;
}

.thumbnail-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.thumbnail-name {
    padding: 8px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.close-modal:hover {
    color: #495057;
}

.loading-spinner {
    padding: 40px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
}

.error-message {
    padding: 20px;
    text-align: center;
    color: #dc3545;
}

.error-message button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.no-images {
    padding: 40px;
    text-align: center;
    color: #6c757d;
}
.image-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7); /* 半透明背景 */
    z-index: 1000; /* 确保足够高 */
    display: flex;
    justify-content: center;
    align-items: center;
}
.image-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 目录项样式 */
.directory-item {
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
}

.directory-item:hover {
    background-color: #f0f0f0;
}

.directory-item.folder {
    font-weight: bold;
}

.directory-item.folder.expanded > .directory-children {
    display: block;
}

.directory-children {
    display: none;
    padding-left: 15px;
}

.directory-tree {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding: 8px 0;
}

.directory-item {
    padding: 6px 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.directory-item:hover {
    background-color: #f5f5f5;
}

.directory-item.folder {
    font-weight: 500;
}

.directory-item.file {
    padding-left: 24px;
    color: #555;
}

.folder-icon, .file-icon {
    margin-right: 6px;
}

.directory-children {
    display: none;
    padding-left: 16px;
}

.directory-item.expanded > .directory-children {
    display: block;
}

/* 加载状态 */
.directory-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.directory-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #333;
    animation: spin 1s ease-in-out infinite;
}

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

/* 错误状态 */
.directory-error {
    padding: 20px;
    text-align: center;
    color: #d32f2f;
}

.directory-error button {
    margin-top: 10px;
    padding: 6px 12px;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.error-details {
    font-size: 12px;
    margin-top: 8px;
    color: #666;
}

.no-data, .no-subitems {
    color: #999;
    font-style: italic;
    padding: 8px 12px;
}

.directory-tree {
    padding: 10px;
}

.directory-item {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    margin: 2px 0;
}

.directory-item.folder {
    font-weight: bold;
    background-color: #f5f5f5;
}

.directory-item.file {
    padding-left: 28px;
    color: #333;
}

.directory-item:hover {
    background-color: #e9e9e9;
}

.folder-icon, .file-icon {
    margin-right: 6px;
}

.directory-children {
    padding-left: 20px;
    border-left: 1px dashed #ccc;
    margin-left: 12px;
}

/* 加载状态 */
.directory-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.directory-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.directory-item:hover {
    background-color: #f5f5f5;
}

.folder-icon {
    margin-right: 8px;
}

/* 图片模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.thumbnails-container {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    overflow-y: auto;
}

.thumbnail-item {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.thumbnail-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.thumbnail-item p {
    margin: 5px 0;
    padding: 0 5px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading, .error {
    padding: 20px;
    text-align: center;
}

/* 目录项样式 */
.directory-item {
    padding: 10px;
    margin: 5px 0;
    background: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.directory-item:hover {
    background: #eaeaea;
}

.folder-icon {
    margin-right: 10px;
    font-size: 18px;
}

/* 模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    overflow: hidden;
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.images-container {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    overflow-y: auto;
    max-height: 70vh;
}

.image-item {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-item p {
    margin: 5px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 状态样式 */
.loading, .no-data, .error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.error {
    color: #d32f2f;
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnails-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
    max-height: 70vh;
}

.thumbnail-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.thumbnail-item:hover {
    transform: scale(1.05);
}

.thumbnail-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

/* 工作区容器 - 修复版 */
.workspace-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto; /* 或者hidden - 根据需求选择 */
    background-color: var(--ps-dark-bg);
}

/* 工作区 - 关键修复 */
#workspace {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 600px; /* 设置最小高度确保有足够空间 */
    background-color: var(--ps-dark-bg);
    background-image: 
        linear-gradient(45deg, #333 25%, transparent 25%, transparent 75%, #333 75%, #333),
        linear-gradient(45deg, #333 25%, transparent 25%, transparent 75%, #333 75%, #333);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
}

/* 工作区项目 - 修复定位 */
.workspace-item {
    position: absolute;
    cursor: move;
    background-color: transparent;
    transition: transform 0.1s ease;
    /* 添加边界限制 */
    max-width: 100%;
    max-height: 100%;
}

.workspace-item.selected {
    outline: 2px solid var(--ps-accent);
    box-shadow: 0 0 0 1px var(--ps-dark-bg);
}

.workspace-item img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    pointer-events: none;
    /* 确保图片不会溢出容器 */
    object-fit: contain;
}

/* 控制台日志样式 */
.log-entry {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.log-time {
    color: #4CAF50;
    margin-right: 8px;
}

.log-action {
    color: #BBBBBB;
}

.log-details {
    color: #888;
    margin: 4px 0 0 20px;
    font-size: 11px;
    overflow-x: auto;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 3px;
    max-height: 150px;
    overflow-y: auto;
}

.log-entry {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.log-time {
    color: #4CAF50;
    margin-right: 8px;
}

.log-action {
    color: #BBBBBB;
}

.log-details {
    color: #888;
    margin: 4px 0 0 20px;
    font-size: 11px;
    overflow-x: auto;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 3px;
    max-height: 150px;
    overflow-y: auto;
}
/* 底部控制台样式修复 */
.bottom-panel {
    height: 150px;
    background-color: var(--unity-light);
    border-top: 1px solid var(--unity-border);
    display: flex;
    flex-direction: column;
}

/* 控制台内容区域 */
#output-content {
    flex: 1; /* 填满剩余空间 */
    overflow-y: auto; /* 允许垂直滚动 */
    padding: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: var(--unity-text);
    background-color: rgba(0, 0, 0, 0.2);
    white-space: pre-wrap; /* 保留换行和空格 */
}

/* 日志条目样式 */
.log-entry {
    margin-bottom: 4px;
    line-height: 1.4;
}

.log-time {
    color: #4CAF50; /* 绿色时间戳 */
}

.log-action {
    color: var(--unity-text-light); /* 白色动作文本 */
}

.log-details {
    color: #BBBBBB;
    margin-left: 12px;
}

#output-content {
    font-family: 'Consolas', monospace;
    font-size: 12px;
    background: #1e1e1e;
    color: #e0e0e0;
    padding: 8px;
    overflow-y: auto;  /* 允许垂直滚动 */
    white-space: nowrap; /* 全局禁止换行 */
}

/* 日志条目样式 */
.log-entry {
    margin-bottom: 2px;
    padding: 2px 0;
    border-bottom: 1px solid #333;
    overflow: hidden;      /* 隐藏溢出内容 */
    text-overflow: ellipsis; /* 超出显示省略号 */
}

.tab-bar {
    display: flex;
    background: #252526;
    border-bottom: 1px solid #454545;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    color: #bbb;
}

.tab.active {
    background: #1e1e1e;
    color: white;
    border-bottom: 2px solid #569cd6;
}

/* 内容面板 */
.tab-content {
    flex: 1;
    overflow: hidden;
}

.tab-pane {
    display: none;
    height: 100%;
    padding: 10px;
    background: #1e1e1e;
    overflow-y: auto;
}

.tab-pane.active {
    display: block;
}

/* Lua代码样式 */
#lua-output-content {
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

#lua-output-code {
    margin: 0;
    white-space: pre-wrap;
    color: #dcdcaa;
    background: #252526;
    padding: 10px;
    border-radius: 4px;
}

#copy-lua-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    background: #569cd6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 菜单栏样式 */
.menu-bar {
    display: flex;
    height: 20px;
    background-color: var(--unity-toolbar);
    border-bottom: 1px solid var(--unity-border);
    padding: 0 10px;
    z-index: 1000; /* 确保菜单在最上层 */
}

.menu-item {
    position: relative; /* 为下拉菜单定位提供参考 */
    padding: 0 10px;
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-item:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 下拉菜单样式 - 修改为向下展开 */
.dropdown-menu {
    position: absolute;
    top: 100%; /* 从菜单项底部开始 */
    left: 0;
    background-color: var(--unity-light);
    border: 1px solid var(--unity-border);
    min-width: 200px;
    z-index: 1001;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* 子菜单样式 - 修改为向右展开 */
.submenu {
    position: absolute;
    top: 0; /* 与父菜单项顶部对齐 */
    left: 100%; /* 从父菜单右侧开始 */
    background-color: var(--unity-light);
    border: 1px solid var(--unity-border);
    min-width: 200px;
    display: none;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* 设置模态框样式 */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.settings-content {
    background-color: var(--unity-light);
    padding: 20px;
    border-radius: 4px;
    min-width: 400px;
}

.settings-section {
    margin: 15px 0;
}

.settings-section label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 浮动面板样式 */
.floating-panel {
    background-color: var(--unity-light);
    border: 1px solid var(--unity-border);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1500;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.tool-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}