/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #1e1e1e;
    color: #cccccc;
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* 动态视口高度，自动适应移动端浏览器UI */
    display: flex;
    flex-direction: column;
}

/* ==================== Monaco Editor 样式覆盖 ==================== */
/* 隐藏 "No suggestions." 消息 */
.monaco-editor .suggest-widget .monaco-list .monaco-scrollable-element .monaco-list-rows[role="presentation"]:empty::after {
    content: '' !important;
}

.monaco-editor .suggest-widget .message {
    display: none !important;
}

/* 编辑器拖拽样式 */
#scriptEditor.drag-over {
    background-color: rgba(0, 122, 204, 0.1) !important;
}

/* ==================== 动态文字提醒 ==================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
    position: relative;
}

.toast.fade-out {
    animation: toastFadeOut 0.5s ease-out forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ==================== 顶部工具栏 ==================== */
.toolbar {
    height: 50px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    flex-shrink: 0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.app-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.toolbar-right {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.toolbar-btn {
    padding: 6px 12px;
    background: #3c3c3c;
    border: 1px solid #505050;
    color: #cccccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toolbar-btn:hover {
    background: #505050;
    border-color: #646464;
}

.toolbar-btn.primary {
    background: #0e639c;
    border-color: #1177bb;
    color: #ffffff;
}

.toolbar-btn.primary:hover {
    background: #1177bb;
}

.toolbar-btn i {
    font-size: 14px;
    margin-right: 4px;
}

/* ==================== 工作区 ==================== */
.workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧边栏：脚本列表 */
.sidebar-left {
    width: 250px;
    background: #252526;
    border-right: 1px solid #3e3e42;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: 40px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.sidebar-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
}

.icon-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 14px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: #3e3e42;
}

.script-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    transition: background 0.2s, border 0.2s;
}

/* 拖放区域激活状态 */
.script-list.drop-zone-active {
    background: rgba(0, 122, 204, 0.1);
    border: 2px dashed #007acc;
    padding: 2px;
}

.script-item {
    padding: 8px 12px;
    margin: 2px 0;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #cccccc;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    position: relative;
}

/* 虚拟文件标记 */
.script-item[data-is-virtual="true"] {
    border-left: 3px solid #4EC9B0;
    padding-left: 9px;
}

.script-item[data-is-virtual="true"] .script-item-content i {
    color: #4EC9B0 !important;
}

.script-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.script-item-close {
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    color: #969696;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.script-item:hover .script-item-close {
    display: flex;
}

.script-item-close:hover {
    background: #505050;
    color: #ff6666;
}

.script-item:hover {
    background: #2a2d2e;
}

.script-item.active {
    background: #0e639c;
    color: #ffffff;
}

/* 拖拽样式 */
.script-item.drag-over {
    border-top: 2px solid #007acc;
    margin-top: 4px;
}

.script-item[draggable="true"]:active {
    cursor: grabbing !important;
}

.script-item-content i {
    font-size: 14px;
    margin-right: 6px;
}

/* 中间：编辑器区域 */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    overflow: hidden;
    position: relative;
    transition: background 0.2s;
}

/* 编辑器拖放区域激活状态 */
.editor-container.editor-drop-active::before {
    content: '拖放文件到此处导入';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 122, 204, 0.1);
    border: 3px dashed #007acc;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #007acc;
    pointer-events: none;
}

.editor-tabs {
    height: 35px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    padding: 0 8px;
    overflow-x: auto;
    flex-shrink: 0;
}

/* 特殊符号面板（无遮罩、可拖动的长条形模态框） */
.symbols-panel-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
}

.symbols-panel-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    width: 480px;
    max-width: 90vw;
}

.symbols-panel-header {
    height: 32px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    cursor: move;
    user-select: none;
}

.symbols-panel-title {
    font-size: 13px;
    color: #cccccc;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.symbols-panel-title i {
    font-size: 12px;
    color: #4ec9b0;
}

.symbols-panel-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #969696;
    font-size: 14px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.symbols-panel-close:hover {
    background: #505050;
    color: #ff4444;
}

.symbols-panel-body {
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* 颜色选择器样式 */
.color-picker-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    width: 620px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.color-picker-body {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 6px;
    overflow-y: auto;
    max-height: 500px;
}

.color-picker-body::-webkit-scrollbar {
    width: 8px;
}

.color-picker-body::-webkit-scrollbar-thumb {
    background: #505050;
    border-radius: 4px;
}

.color-picker-body::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

.color-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.color-item:hover {
    transform: scale(1.15);
    border-color: #007acc;
    box-shadow: 0 0 8px rgba(0, 122, 204, 0.5);
    z-index: 10;
}

.color-item:active {
    transform: scale(1.05);
}

.color-index {
    position: absolute;
    bottom: 2px;
    right: 0;
    left: 0;
    text-align: center;
    font-size: 9px;
    color: #ffffff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.6);
    font-weight: bold;
    pointer-events: none;
}

/* 特殊符号快捷插入栏（已移除，保留样式以防其他地方使用） */
.special-symbols-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid #3e3e42;
    flex: 1;
    overflow-x: auto;
}

.special-symbols-bar::-webkit-scrollbar {
    height: 4px;
}

.special-symbols-bar::-webkit-scrollbar-thumb {
    background: #505050;
    border-radius: 2px;
}

.symbols-label {
    font-size: 12px;
    color: #858585;
    white-space: nowrap;
    margin-right: 4px;
}

.symbol-btn {
    min-width: fit-content;
    height: 24px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid #3e3e42;
    color: #cccccc;
    font-size: 14px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    white-space: nowrap;
}

.symbol-btn:hover {
    background: #3e3e42;
    color: #fffb00;
    transform: scale(1.1);
}

.symbol-btn:active {
    background: #505050;
    transform: scale(0.95);
}

.tab {
    height: 28px;
    padding: 0 12px;
    background: transparent;
    border: none;
    border-radius: 3px 3px 0 0;
    color: #969696;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.tab:hover {
    background: #2a2d2e;
    color: #ffffff;
}

.tab.active {
    background: #1e1e1e;
    color: #ffffff;
}

.tab-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-close {
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    color: #969696;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-close:hover {
    background: #505050;
    color: #ffffff;
}

.tab-save {
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    color: #969696;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-save:hover {
    background: #505050;
    color: #4EC9B0;
}

.tab-save.modified {
    color: #ff4444;
}

.tab-save.modified:hover {
    color: #ff6666;
}

.editor-main {
    flex: 1;
    overflow: hidden;
}

#scriptEditor {
    width: 100%;
    height: 100%;
}

.editor-footer {
    height: 35px;
    background: #2d2d30;
    border-top: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
}

.editor-actions {
    display: flex;
    gap: 4px;
}

.editor-zoom-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #858585;
    padding: 0 8px;
    user-select: none;
}

.editor-zoom-info i {
    font-size: 11px;
}

.editor-zoom-info span {
    min-width: 40px;
    text-align: center;
    font-family: 'Consolas', monospace;
}

.editor-action-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 14px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.editor-action-btn:hover:not(:disabled) {
    background: #3e3e42;
    color: #ffffff;
}

.editor-action-btn:active:not(:disabled) {
    background: #505050;
}

.editor-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.script-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    color: #cccccc;
}

.script-mode-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #007acc;
}

.script-mode-toggle:hover span {
    color: #ffffff;
}

/* 右侧边栏：命令面板 */
.sidebar-right {
    width: 280px;
    background: #252526;
    border-left: 1px solid #3e3e42;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.command-search {
    padding: 8px 12px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    position: relative;
}

.command-search input {
    width: 100%;
    padding: 6px 30px 6px 10px;
    background: #3c3c3c;
    border: 1px solid #505050;
    border-radius: 3px;
    color: #cccccc;
    font-size: 13px;
    outline: none;
}

.command-search input:focus {
    border-color: #007acc;
}

.search-clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #969696;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s;
}

.search-clear-btn:hover {
    background: #505050;
    color: #ffffff;
}

.command-panel {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.command-group {
    margin-bottom: 8px;
}

.command-group-header {
    padding: 8px 12px;
    background: #2d2d30;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.command-group-header span i {
    margin-right: 6px;
}

.command-group-header:hover {
    background: #37373d;
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.command-group-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.command-group-content {
    margin-top: 4px;
    padding-left: 4px;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 滚动条样式优化 */
.command-group-content::-webkit-scrollbar {
    width: 8px;
}

.command-group-content::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

.command-group-content::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 4px;
    transition: background 0.2s;
}

.command-group-content::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

.command-group-content.hidden {
    display: none;
}

.command-item {
    padding: 6px 12px;
    margin: 2px 0;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.command-item:hover {
    background: #2a2d2e;
}

.command-item.dragging {
    opacity: 0.5;
    background: #007acc !important;
    transform: scale(0.98);
    transition: all 0.2s ease;
}

.command-name {
    font-size: 12px;
    color: #4EC9B0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
}

.command-desc {
    font-size: 11px;
    color: #969696;
    margin-top: 2px;
}

/* ==================== 底部日志面板 ==================== */
.bottom-panel {
    height: 200px;
    background: #1e1e1e;
    border-top: 1px solid #3e3e42;
    display: flex;
    flex-shrink: 0;
}

.bottom-panel-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3e3e42;
}

.bottom-panel-right {
    width: 400px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.bottom-panel-header {
    height: 35px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.bottom-panel-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #cccccc;
    line-height: 1.5;
}

.log-content div {
    margin-bottom: 3px;
    padding: 2px 0;
}

.env-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* APP图标网格布局 */
.env-app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    padding: 15px;
}

.env-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: #2d2d30;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.env-app-item:hover {
    background: #37373d;
    border-color: #007acc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.env-app-item:active {
    transform: translateY(0);
}

/* APP激活状态（对应的模态框打开时） */
.env-app-item.active {
    background: #37373d;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.env-app-item.active .env-app-icon {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.4);
}

.env-app-item.active .env-app-label {
    color: #007acc;
    font-weight: 600;
}

.env-app-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    font-size: 20px;
    color: #ffffff;
    transition: all 0.2s ease;
}

.env-app-item:nth-child(2) .env-app-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.env-app-item:nth-child(3) .env-app-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.env-app-item:nth-child(4) .env-app-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.env-app-item:hover .env-app-icon {
    transform: scale(1.1);
}

.env-app-label {
    font-size: 11px;
    color: #cccccc;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

.env-section {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3e3e42;
}

.env-section:last-child {
    border-bottom: none;
}

.env-section-title {
    font-size: 12px;
    color: #569CD6;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.env-item {
    font-size: 12px;
    color: #cccccc;
    margin-bottom: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
}

.env-item span {
    color: #4EC9B0;
    font-weight: 600;
}

.env-list {
    font-size: 11px;
    color: #cccccc;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.8;
    max-height: 150px;
    overflow-y: auto;
}

.env-list div {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.env-list div:last-child {
    border-bottom: none;
}

/* ==================== NPC对话预览面板 ==================== */
.dialog-panel {
    position: fixed;
    top: 80px;
    right: 30px;
    min-width: 400px;
    background: #2d2d30;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px); /* 动态视口高度 */
}

.dialog-panel-header {
    height: 45px;
    background: #37373d;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid #3e3e42;
}

.dialog-panel-header h3 {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    margin: 0;
}

.dialog-panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.panel-action-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-action-btn:hover {
    background: #505050;
    color: #ffffff;
}

.panel-close-btn {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close-btn:hover {
    background: #e74c3c;
    color: #ffffff;
}

.dialog-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.dialog-body {
    padding: 15px;
    min-height: 150px;
    background: #2c3e50;
    font-family: 'SimSun', '宋体', serif;
    font-size: 12px;
    color: #ffffff;
    border-radius: 4px;
}

.dialog-text {
    font-size: 12px;
    line-height: 1.3;
    color: #ffffff;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SimSun', '宋体', serif;
}

.dialog-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.dialog-option {
    display: inline;
    padding: 0;
    background: none;
    color: #FFD700;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 12px;
    border: none;
    font-family: 'SimSun', '宋体', serif;
}

.dialog-option:hover {
    color: #FFA500;
}

.dialog-option:active {
    color: #ff0000;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

/* ==================== 响应式 ==================== */

/* 移动端面板切换按钮 */
.mobile-panel-toggle {
    width: 36px;
    height: 36px;
    background: #3c3c3c;
    border: 1px solid #505050;
    border-radius: 4px;
    color: #cccccc;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: all 0.2s;
}

.mobile-panel-toggle:hover {
    background: #505050;
    border-color: #646464;
}

.mobile-panel-toggle.active {
    background: #0e639c;
    border-color: #1177bb;
    color: #ffffff;
}

.mobile-panel-toggle i {
    font-size: 16px;
}

/* 移动端更多菜单 */
.mobile-more-menu {
    position: relative;
    display: none;
}

.mobile-more-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #2d2d30;
    border: 1px solid #505050;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    min-width: 160px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.mobile-more-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cccccc;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
    border-bottom: 1px solid #3e3e42;
}

.mobile-menu-item:last-child {
    border-bottom: none;
}

.mobile-menu-item:hover {
    background: #3e3e42;
}

.mobile-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.mobile-menu-item span {
    flex: 1;
}

/* 面板遮罩层（移动端点击其他区域关闭面板） */
.mobile-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.mobile-panel-overlay.active {
    display: block;
}

@media (max-width: 1200px) {
    .sidebar-left {
        width: 200px;
    }
    
    .sidebar-right {
        width: 250px;
    }
}

/* 小屏幕优化（小于800px） */
@media (max-width: 800px) {
    /* 显示移动端切换按钮 */
    .mobile-panel-toggle {
        display: flex !important;
    }
    
    /* 隐藏工具栏按钮文字，只显示图标 */
    #syncScriptBtn .btn-text,
    #openFileBtn .btn-text,
    #downloadScriptBtn .btn-text,
    #joinQQGroupBtn .btn-text {
        display: none;
    }
    
    /* 显示移动端更多菜单 */
    .mobile-more-menu {
        display: block !important;
    }
    
    /* 隐藏原始按钮（除了NPC预览） */
    #syncScriptBtn,
    #openFileBtn,
    #downloadScriptBtn,
    #joinQQGroupBtn {
        display: none !important;
    }
    
    /* 默认隐藏所有面板 */
    .sidebar-left,
    .sidebar-right,
    .bottom-panel {
        position: fixed;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    /* 脚本列表面板 */
    .sidebar-left {
        top: 50px;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 80vw;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    }
    
    @supports (top: env(safe-area-inset-top)) {
        .sidebar-left {
            top: calc(50px + env(safe-area-inset-top));
        }
    }
    
    .sidebar-left.mobile-visible {
        transform: translateX(0);
    }
    
    /* 命令面板 */
    .sidebar-right {
        top: 50px;
        right: 0;
        bottom: 0;
        left: auto;
        width: 280px;
        max-width: 80vw;
        transform: translateX(100%);
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
    }
    
    @supports (top: env(safe-area-inset-top)) {
        .sidebar-right {
            top: calc(50px + env(safe-area-inset-top));
        }
    }
    
    .sidebar-right.mobile-visible {
        transform: translateX(0);
    }
    
    /* 日志和虚拟环境面板 */
    .bottom-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        height: 60vh;
        max-height: 400px;
        transform: translateY(100%);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
        flex-direction: column;
    }
    
    .bottom-panel.mobile-visible {
        transform: translateY(0);
    }
    
    /* 底部面板内容重新布局 */
    .bottom-panel-left,
    .bottom-panel-right {
        border-right: none;
        border-bottom: 1px solid #3e3e42;
    }
    
    .bottom-panel-right {
        width: 100%;
        flex: 1;
        min-height: 0;
    }
    
    .bottom-panel-left {
        flex: 0 0 auto;
        max-height: 180px;
        min-height: 140px;
    }
    
    /* 日志面板内容高度限制 */
    .bottom-panel-left .log-content {
        max-height: 140px;
        overflow-y: auto;
    }
    
    /* 编辑器区域占满屏幕 */
    .editor-container {
        flex: 1;
    }
    
    /* 工具栏优化 */
    .toolbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 50px;
        padding: 8px 10px;
    }
    
    .toolbar-left {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: wrap;
        flex: 0 0 auto;
    }
    
    .toolbar-center {
        flex: 1 1 auto;
        justify-content: center;
        margin: 0 8px;
        order: 2;
    }
    
    .toolbar-right {
        flex: 0 0 auto;
        justify-content: flex-end;
        flex-wrap: wrap;
        order: 3;
    }
    
    /* NPC预览按钮在小屏幕时保持突出 */
    #togglePreviewBtn {
        font-weight: 600;
    }
    
    .toolbar-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .toolbar-btn i {
        font-size: 12px;
        margin-right: 2px;
    }
    
    .app-title {
        font-size: 14px;
        white-space: nowrap;
    }
    
    /* 虚拟环境APP网格优化 - 保持4列 */
    .env-app-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 8px;
    }
    
    .env-app-item {
        gap: 4px;
    }
    
    .env-app-icon {
        font-size: 20px;
    }
    
    .env-app-label {
        font-size: 10px;
    }
    
    /* ✅ 移除移动端NPC预览面板特殊样式，与PC端保持一致 */
    /* .dialog-panel 使用PC端样式，支持居中显示和拖动 */
    
    /* 虚拟服务器面板移动端优化 */
    .virtual-server-window {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .virtual-server-toolbar {
        height: auto;
        min-height: 45px;
        flex-wrap: wrap;
        padding: 8px;
        gap: 6px;
    }
    
    .vs-toolbar-left,
    .vs-toolbar-right {
        flex-wrap: wrap;
    }
    
    .vs-path-bar {
        width: 100%;
        flex: 1 1 100%;
        font-size: 11px;
        padding: 0 8px;
        height: 28px;
    }
    
    .vs-encoding-select {
        height: 28px;
        font-size: 11px;
    }
    
    .vs-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .virtual-server-actions-bar {
        height: auto;
        min-height: 40px;
        flex-wrap: nowrap;
        padding: 6px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 隐藏滚动条但保持滚动功能 */
    .virtual-server-actions-bar::-webkit-scrollbar {
        height: 4px;
    }
    
    .virtual-server-actions-bar::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .virtual-server-actions-bar::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
    
    .virtual-server-actions-bar::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .vs-action-bar-btn {
        height: 28px;
        padding: 0 10px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .virtual-server-content.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    
    .vs-item-icon {
        font-size: 32px;
    }
    
    .vs-item-name {
        font-size: 11px;
    }
    
    .virtual-server-status {
        height: 28px;
        padding: 0 10px;
        font-size: 11px;
    }
}

/* 极小屏幕优化（小于480px） */
@media (max-width: 480px) {
    .mobile-panel-toggle {
        width: 32px;
        height: 32px;
    }
    
    .mobile-panel-toggle i {
        font-size: 14px;
    }
    
    .toolbar-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .toolbar-btn i {
        font-size: 11px;
    }
    
    .app-title {
        font-size: 12px;
    }
    
    /* 更多按钮优化 */
    #mobileMoreBtn {
        padding: 6px 10px;
    }
    
    /* 下拉菜单优化 */
    .mobile-more-dropdown {
        min-width: 140px;
        font-size: 12px;
    }
    
    .mobile-menu-item {
        padding: 10px 12px;
        font-size: 12px;
        gap: 8px;
    }
    
    /* 面板宽度调整 */
    .sidebar-left,
    .sidebar-right {
        max-width: 90vw;
    }
    
    /* 虚拟环境APP网格保持4列 */
    .env-app-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 6px;
    }
    
    .env-app-item {
        gap: 3px;
    }
    
    .env-app-icon {
        font-size: 16px;
    }
    
    .env-app-label {
        font-size: 9px;
    }
    
    /* 虚拟服务器面板极小屏幕优化 */
    .virtual-server-header {
        height: 36px;
        padding: 0 8px;
    }
    
    .virtual-server-title {
        font-size: 12px;
    }
    
    .vs-action-btn {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .virtual-server-toolbar {
        padding: 6px;
        gap: 4px;
    }
    
    .vs-path-bar {
        font-size: 10px;
        height: 26px;
        padding: 0 6px;
    }
    
    .vs-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .vs-encoding-select {
        height: 26px;
        font-size: 10px;
        padding: 0 6px;
    }
    
    .virtual-server-actions-bar {
        padding: 4px 6px;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .vs-action-bar-btn {
        height: 26px;
        padding: 0 8px;
        font-size: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .virtual-server-content.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
        padding: 8px;
    }
    
    .vs-item-icon {
        font-size: 28px;
    }
    
    .vs-item-name {
        font-size: 10px;
    }
    
    .virtual-server-status {
        height: 26px;
        padding: 0 8px;
        font-size: 10px;
    }
}

/* ==================== 虚拟服务器样式 ==================== */
.virtual-server-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.virtual-server-window {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 650px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    overflow: hidden;
}

.virtual-server-header {
    height: 40px;
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
    border-bottom: 1px solid #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    cursor: grab;
    user-select: none;
}

.virtual-server-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.virtual-server-title i {
    color: #0078d4;
}

.virtual-server-actions {
    display: flex;
    gap: 4px;
}

.vs-action-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

#vsCloseBtn:hover {
    background: #e81123;
    color: #ffffff;
}

.virtual-server-toolbar {
    height: 45px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
}

.vs-toolbar-left,
.vs-toolbar-right {
    display: flex;
    gap: 4px;
    align-items: center;
}

.vs-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-btn:hover {
    background: #e5e5e5;
    border-color: #d0d0d0;
}

.vs-path-bar {
    flex: 1;
    height: 30px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

.vs-path-bar i {
    color: #0078d4;
}

.vs-encoding-select {
    height: 30px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    color: #333;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.vs-encoding-select:focus {
    border-color: #0078d4;
}

.virtual-server-actions-bar {
    height: 45px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
}

.vs-action-bar-btn {
    height: 32px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    color: #333;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vs-action-bar-btn:hover {
    background: #e5e5e5;
    border-color: #0078d4;
}

.vs-action-bar-btn i {
    font-size: 13px;
}

.virtual-server-content {
    flex: 1;
    background: #ffffff;
    overflow-y: auto;
    padding: 15px;
}

/* 横向排列（网格视图） */
.virtual-server-content.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    align-content: start;
}

/* 纵向排列（列表视图） */
.virtual-server-content.view-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vs-file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    user-select: none;
}

/* 可拖拽文件样式 */
.vs-file-item[draggable="true"] {
    cursor: grab;
}

.vs-file-item[draggable="true"]:active {
    cursor: grabbing;
}

.view-grid .vs-file-item {
    gap: 8px;
}

.view-list .vs-file-item {
    flex-direction: row;
    gap: 10px;
    padding: 6px 10px;
}

.vs-file-item:hover {
    background: #e5f3ff;
}

.vs-file-item.selected {
    background: #cce8ff;
}

.vs-item-icon {
    font-size: 40px;
}

.view-list .vs-item-icon {
    font-size: 20px;
}

.vs-item-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    word-break: break-all;
    max-width: 100%;
}

.view-list .vs-item-name {
    text-align: left;
    flex: 1;
}

.vs-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.virtual-server-status {
    height: 30px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    font-size: 12px;
    color: #666;
}

/* 虚拟服务器Toast提示 */
.vs-toast {
    position: fixed;
    bottom: 50px;
    right: 50px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.vs-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 消息框样式 ==================== */
.messagebox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    transition: opacity 0.3s ease;
}

.messagebox {
    background: #2d2d30;
    border-radius: 8px;
    padding: 20px;
    min-width: 380px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #3e3e42;
}

.messagebox-content {
    font-size: 14px;
    line-height: 1.6;
    color: #cccccc;
    margin-bottom: 20px;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SimSun', '宋体', serif;
}

.messagebox-btn {
    align-self: flex-end;
    padding: 8px 24px;
    font-size: 13px;
    background: #007acc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.messagebox-btn:hover {
    background: #005a9e;
    transform: translateY(-1px);
}

.messagebox-btn:active {
    transform: translateY(0);
    background: #004578;
}

.messagebox-btn-cancel {
    background: #5a5a5a;
}

.messagebox-btn-cancel:hover {
    background: #707070;
}

.messagebox-btn-cancel:active {
    background: #4a4a4a;
}

/* ==================== 网站模态框 ==================== */
.website-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10003;
    transition: opacity 0.3s ease;
}

.website-modal {
    background: #1e1e1e;
    border-radius: 8px;
    width: 800px;
    height: 550px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    border: 1px solid #3e3e42;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.website-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    flex-shrink: 0;
}

.website-modal-title {
    font-size: 14px;
    color: #cccccc;
    font-weight: 500;
}

.website-modal-close {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.website-modal-close:hover {
    color: #ffffff;
    background: #3e3e42;
}

.website-modal-content {
    flex: 1;
    overflow: hidden;
    background: #ffffff;
}

/* ==================== 变量设置模态框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 节点表模态框：无背景遮罩 */
.modal-overlay-no-bg {
    background: transparent;
    pointer-events: none;
}

.modal-overlay-no-bg .modal-dialog {
    pointer-events: all;
}

.modal-overlay[style*="display: flex"] {
    opacity: 1;
}

.modal-dialog {
    background: #2d2d30;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #3e3e42;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

/* 可拖拽模态框 */
.modal-dialog-draggable {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: default;
    border-radius: 4px;
}

.modal-header-draggable {
    cursor: move;
    user-select: none;
}

.modal-overlay[style*="display: flex"] .modal-dialog {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #3e3e42;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #cccccc;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-refresh-btn {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.modal-refresh-btn:hover {
    color: #007acc;
    background: #3e3e42;
    transform: rotate(180deg);
}

.modal-refresh-btn:active {
    transform: rotate(360deg);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
    background: #3e3e42;
    border-radius: 4px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    border-radius: 4px;
}

/* 变量设置、角色属性、英雄设置模态框的body使用更浅的背景色 */
#variableSettingsModal .modal-body,
#attributeSettingsModal .modal-body,
#heroSettingsModal .modal-body {
    background: #3a3a3d;
}

.variable-settings-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.variable-type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3e3e42;
}

.var-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: #3e3e42;
    color: #cccccc;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Monaco', monospace;
}

.var-tab-btn:hover {
    background: #505050;
    border-color: #007acc;
}

.var-tab-btn.active {
    background: #007acc;
    color: #ffffff;
    border-color: #007acc;
}

.variable-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.variable-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.variable-input-group label {
    min-width: 80px;
    font-size: 13px;
    color: #cccccc;
}

.variable-input-group input {
    flex: 1;
    padding: 8px 12px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.variable-input-group input:focus {
    outline: none;
    border-color: #007acc;
}

.variable-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #007acc;
    color: #ffffff;
}

.btn-primary:hover {
    background: #005a9e;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #3e3e42;
    color: #cccccc;
    border: 1px solid #555555;
}

.btn-secondary:hover {
    background: #505050;
    border-color: #007acc;
}

.variable-info {
    margin-top: 15px;
    padding: 12px;
    background: #252526;
    border-left: 3px solid #007acc;
    border-radius: 4px;
}

.var-type-desc {
    margin: 0;
    font-size: 12px;
    color: #cccccc;
    line-height: 1.6;
}

.var-type-desc strong {
    color: #4ec9b0;
}

/* 自定义变量专用按钮样式 */
.btn-danger {
    padding: 10px 20px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #d32f2f;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b71c1c;
    transform: translateY(-1px);
}

.btn-mini {
    padding: 2px 8px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #007acc;
    color: #ffffff;
}

.btn-mini:hover {
    background: #005a9e;
}

.variable-input-group code {
    background: #1e1e1e;
    padding: 2px 6px;
    border-radius: 3px;
    color: #ce9178;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
}

/* ==================== 文件编辑器样式 ==================== */
.vs-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002; /* 比虚拟服务器更高 */
    opacity: 1;
    transition: opacity 0.3s ease;
}

.vs-editor-window {
    width: 80%;
    max-width: 500px;
    height: 80%;
    max-height: 370px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.vs-editor-header {
    height: 40px;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    border-bottom: 1px solid #d0d0d0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    cursor: grab;
    user-select: none;
}

.vs-editor-header:active {
    cursor: grabbing;
}

.vs-editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.vs-editor-title i {
    color: #0078d4;
}

.vs-editor-actions {
    display: flex;
    gap: 8px;
}

.vs-editor-action-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #666;
}

.vs-editor-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.vs-editor-content {
    flex: 1;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
}

.vs-editor-textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    resize: none;
    background: #ffffff;
    tab-size: 4;
}

.vs-editor-textarea:focus {
    background: #fafafa;
}

.vs-editor-footer {
    height: 60px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    gap: 10px;
}

.vs-editor-btn {
    padding: 8px 20px;
    font-size: 13px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    background: #0078d4;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.vs-editor-btn:hover {
    background: #005a9e;
    border-color: #005a9e;
}

.vs-editor-btn i {
    font-size: 12px;
}

.vs-editor-btn-secondary {
    background: #ffffff;
    color: #333;
    border-color: #d0d0d0;
}

.vs-editor-btn-secondary:hover {
    background: #e5e5e5;
    border-color: #999;
}

/* ==================== 属性设置模态框 ==================== */
.modal-dialog-compact {
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-body-compact {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.attribute-settings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 属性面板切换按钮 */
.attribute-tabs {
    display: flex;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3e3e42;
    flex-wrap: wrap;
}

.attr-tab-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #3e3e42;
    color: #cccccc;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.attr-tab-btn i {
    font-size: 11px;
}

.attr-tab-btn:hover {
    background: #505050;
    border-color: #007acc;
}

.attr-tab-btn.active {
    background: #007acc;
    color: #ffffff;
    border-color: #007acc;
}

/* 属性面板内容 */
.attribute-panels {
    min-height: 350px;
    max-height: 450px;
    overflow-y: auto;
}

.attr-panel {
    display: none;
}

.attr-panel.active {
    display: block;
}

/* 属性网格布局 */
.attr-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.attr-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.attr-item label {
    font-size: 12px;
    color: #cccccc;
    font-weight: 500;
}

.attr-item input,
.attr-item select {
    padding: 7px 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.attr-item input:focus,
.attr-item select:focus {
    outline: none;
    border-color: #007acc;
}

.attr-item select {
    cursor: pointer;
}

/* 物品管理 */
.item-management,
.skill-management,
.equipment-management,
.title-management {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 装备网格布局 */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.equip-slot {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.equip-slot label {
    font-size: 12px;
    color: #cccccc;
    font-weight: 500;
}

.equip-slot input {
    padding: 7px 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    font-size: 12px;
}

.equip-slot input:focus {
    outline: none;
    border-color: #007acc;
}

.equip-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #3e3e42;
}

.item-input-group,
.skill-input-group,
.slave-input-group,
.title-input-group {
    color: #cccccc;
}

.item-input-group input,
.skill-input-group input,
.slave-input-group input,
.title-input-group input,
.item-input-group select {
    flex: 1;
    padding: 7px 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    font-size: 12px;
    outline: none;
}

.item-input-group select {
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.item-input-group select:hover {
    border-color: #007acc;
}

.item-input-group select:focus {
    border-color: #007acc;
}

.item-input-group input:nth-child(2),
.skill-input-group input:nth-child(2),
.slave-input-group input:nth-child(2) {
    flex: 0 0 80px;
}

/* 物品名称输入框 */
.item-input-group input:first-child {
    flex: 2;
}

/* 数量输入框 */
.item-input-group input[type="number"] {
    flex: 0 0 80px;
}

/* 物品类型选择 */
.item-input-group select#itemTypeSelect,
.item-input-group select#heroItemTypeSelect {
    flex: 0 0 140px;
}

/* 装备位选择 */
.item-input-group select#itemEquipSlotSelect,
.item-input-group select#heroItemEquipSlotSelect {
    flex: 0 0 140px;
}

.btn-sm {
    padding: 7px 15px;
    font-size: 12px;
    white-space: nowrap;
}

.item-list-container,
.skill-list-container,
.slave-list-container,
.title-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-list-container h4,
.skill-list-container h4,
.slave-list-container h4,
.title-list-container h4 {
    margin: 0;
    font-size: 13px;
    color: #cccccc;
    padding-bottom: 8px;
    border-bottom: 1px solid #3e3e42;
}

.item-list,
.skill-list,
.slave-list,
.title-list {
    max-height: 250px;
    overflow-y: auto;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
}

.item-entry,
.skill-entry,
.slave-entry,
.title-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #252526;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 12px;
}

.item-entry:last-child,
.skill-entry:last-child,
.slave-entry:last-child,
.title-entry:last-child {
    margin-bottom: 0;
}

.item-info,
.skill-info,
.slave-info,
.title-info {
    color: #cccccc;
    flex: 1;
}

.title-entry.equipped .title-info {
    color: #ffd700;
    font-weight: bold;
}

.title-badge {
    display: inline-block;
    background: #007acc;
    color: #ffffff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

.title-actions {
    display: flex;
    gap: 5px;
}

.item-count,
.skill-level,
.slave-level {
    color: #4ec9b0;
    margin-left: 8px;
}

.slave-count {
    color: #4ec9b0;
    font-size: 11px;
}

.slave-name {
    color: #dcdcaa;
}

.remove-item-btn,
.remove-skill-btn,
.remove-slave-btn,
.remove-title-btn,
.equip-title-btn {
    background: transparent;
    border: none;
    color: #f48771;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
    font-size: 11px;
}

.remove-item-btn:hover,
.remove-skill-btn:hover,
.remove-slave-btn:hover,
.remove-title-btn:hover {
    background: #3e3e42;
    color: #ff6b6b;
}

.equip-title-btn {
    color: #4ec9b0;
}

.equip-title-btn:hover {
    background: #3e3e42;
    color: #5fd3b3;
}

.equip-title-btn.equipped {
    color: #ffd700;
}

.equip-title-btn.equipped:hover {
    color: #ffed4e;
}

/* 物品操作按钮容器 */
.item-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* 穿戴按钮 */
.equip-item-btn {
    background: transparent;
    border: none;
    color: #4ec9b0;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
    font-size: 11px;
}

.equip-item-btn:hover {
    background: #3e3e42;
    color: #5fd3b3;
}

/* 使用按钮 */
.use-item-btn {
    background: transparent;
    border: none;
    color: #ffd700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
    font-size: 11px;
}

.use-item-btn:hover {
    background: #3e3e42;
    color: #ffed4e;
}

/* 底部操作按钮 */
.attr-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #3e3e42;
    justify-content: flex-end;
}

.attr-actions .btn-primary,
.attr-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 空状态提示 */
.empty-list {
    text-align: center;
    color: #888;
    font-size: 12px;
    padding: 20px;
}

/* ==================== 英雄设置模态框 ==================== */
.hero-settings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 英雄面板切换按钮 */
.hero-tabs {
    display: flex;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3e3e42;
    flex-wrap: wrap;
}

.hero-tab-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #3e3e42;
    color: #cccccc;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hero-tab-btn i {
    font-size: 11px;
}

.hero-tab-btn:hover {
    background: #505050;
    border-color: #007acc;
}

.hero-tab-btn.active {
    background: #007acc;
    color: #ffffff;
    border-color: #007acc;
}

/* 英雄面板内容 */
.hero-panels {
    min-height: 350px;
    max-height: 450px;
    overflow-y: auto;
}

.hero-panel {
    display: none;
}

.hero-panel.active {
    display: block;
}

/* 英雄主页 */
.hero-main-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hero-status {
    padding: 12px;
    background: #252526;
    border-radius: 4px;
    border-left: 3px solid #007acc;
}

.hero-enable-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #cccccc;
    cursor: pointer;
}

.hero-enable-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.hero-overview {
    padding: 15px;
    background: #252526;
    border-radius: 4px;
}

.hero-overview h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #4ec9b0;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 8px;
}

.hero-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.hero-info-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: #1e1e1e;
    border-radius: 4px;
    font-size: 12px;
}

.hero-info-item label {
    color: #888;
    font-weight: 500;
}

.hero-info-item span {
    color: #cccccc;
}

/* 英雄底部操作按钮 */
.hero-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #3e3e42;
    justify-content: flex-end;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 英雄状态卡片 */
.hero-status-card {
    background: #252526;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #3e3e42;
}

.hero-status-header {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3e3e42;
}

.hero-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #cccccc;
}

.hero-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-text {
    font-weight: 500;
    color: #4ec9b0;
}

.hero-basic-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1e1e1e;
    border-radius: 4px;
    font-size: 13px;
}

.hero-label {
    color: #888;
    font-weight: 500;
    min-width: 60px;
}

.hero-info-row span:last-child {
    color: #cccccc;
    font-weight: 500;
}

/* 模态框底部操作栏 */
.modal-footer {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #3e3e42;
    justify-content: flex-end;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
}

/* 脚本节点表样式 */
.node-search-container {
    position: relative;
    margin-bottom: 15px;
}

.node-search-input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.node-search-input:focus {
    border-color: #007acc;
}

.node-search-input::placeholder {
    color: #666;
}

.node-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 13px;
    pointer-events: none;
}

.node-list-container {
    max-height: 400px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 10px;
}

.node-list-item {
    padding: 10px 12px;
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.node-list-item:hover {
    background: #2d2d30;
    border-color: #007acc;
}

.node-list-item:active {
    transform: translateY(0);
}

.node-name {
    font-size: 14px;
    color: #cccccc;
    font-weight: 500;
    display: block;
    text-align: center;
}

.node-index {
    font-size: 11px;
    color: #007acc;
    font-weight: 600;
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 122, 204, 0.15);
    border-radius: 3px;
    align-self: flex-start;
    margin-bottom: 2px;
}

/* OK框样式 */
.upgrade-slot {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 100%);
    border: 3px solid #007acc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 122, 204, 0.3);
}

.upgrade-slot:hover {
    border-color: #1e90ff;
    box-shadow: 0 0 30px rgba(30, 144, 255, 0.5);
    transform: scale(1.05);
}

.upgrade-slot-empty {
    color: #666;
    font-size: 13px;
    text-align: center;
    padding: 0 15px;
    line-height: 1.4;
}

.upgrade-slot-item {
    color: #4ec9b0;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    padding: 0 15px;
    line-height: 1.4;
    word-break: break-all;
}

.upgrade-slot.has-item {
    border-color: #4ec9b0;
    box-shadow: 0 0 25px rgba(78, 201, 176, 0.4);
}

.upgrade-bag-list {
    max-height: 350px;
    overflow-y: auto;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
}

.upgrade-bag-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upgrade-bag-item:hover {
    background: #2d2d30;
    border-color: #007acc;
    transform: translateX(5px);
}

.upgrade-bag-item:last-child {
    margin-bottom: 0;
}

.upgrade-bag-item-name {
    color: #cccccc;
    font-size: 13px;
    font-weight: 500;
}

.upgrade-bag-item-count {
    color: #4ec9b0;
    font-size: 12px;
    margin-left: 8px;
}

/* 物品类型和装备位样式 */
.item-type {
    color: #4ec9b0;
    font-size: 12px;
    margin-left: 8px;
}

.item-slot {
    color: #007acc;
    font-size: 12px;
    margin-left: 4px;
}

/* ==================== 脚本同步配置 ==================== */
/* 采用与虚拟服务器一致的Windows风格 */
.sync-modal-custom {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.sync-modal-header {
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
    border-bottom: 1px solid #d0d0d0;
    padding: 12px 16px;
}

.sync-modal-header h3 {
    font-size: 15px;
    color: #333;
}

.sync-modal-header h3 i {
    color: #0078d4;
}

.sync-modal-body {
    padding: 15px;
    background: #fafafa;
}

.sync-config-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 标签页切换 */
.sync-tabs {
    display: flex;
    border-bottom: 1px solid #d0d0d0;
    margin-bottom: 15px;
    background: #ffffff;
    border-radius: 4px 4px 0 0;
}

.sync-tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: #f5f5f5;
    border: none;
    border-bottom: 2px solid transparent;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sync-tab-btn:first-child {
    border-radius: 4px 0 0 0;
}

.sync-tab-btn:last-child {
    border-radius: 0 4px 0 0;
}

.sync-tab-btn:hover {
    background: #e5e5e5;
    color: #333;
}

.sync-tab-btn.active {
    background: #ffffff;
    color: #0078d4;
    border-bottom-color: #0078d4;
    font-weight: 500;
}

.sync-tab-btn i {
    font-size: 13px;
}

/* 标签页内容 */
.sync-tab-content {
    display: none;
}

.sync-tab-content.active {
    display: block;
}

/* 服务器列表页 */
.sync-server-list-page {
    min-height: 240px;
    background: #ffffff;
    border-radius: 4px;
    padding: 10px;
}

.sync-server-items {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* 添加服务器页 */
.sync-add-server-page {
    padding: 5px 0;
}

/* 服务端下载区域 */
.sync-server-download {
    max-width: 100%;
    margin: 15px 0 20px;
    background: linear-gradient(180deg, #f9f9f9 0%, #f0f0f0 100%);
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #d0d0d0;
}

.download-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.download-header i {
    color: #0078d4;
    font-size: 16px;
}

.download-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #ffffff;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.download-info {
    flex: 1;
}

.download-name {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    margin-bottom: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.download-size {
    font-size: 11px;
    color: #666;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #0078d4;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-download:hover {
    background: #005a9e;
}

.btn-download:active {
    transform: scale(0.98);
}

.btn-download i {
    font-size: 13px;
}

.download-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    color: #666;
    line-height: 1.5;
}

.download-tip i {
    color: #0078d4;
    margin-top: 2px;
    flex-shrink: 0;
}

.sync-form {
    max-width: 100%;
    margin: 0;
    background: #ffffff;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.sync-form-row {
    display: flex;
    gap: 12px;
}

.sync-form-group {
    margin-bottom: 18px;
}

.sync-form-group-half {
    flex: 1;
}

.sync-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 500;
}

.sync-form-group label i {
    color: #0078d4;
    width: 14px;
}

.sync-form-group input {
    width: 100%;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    color: #333;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.sync-form-group input:focus {
    border-color: #0078d4;
}

.sync-form-group small {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.sync-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.sync-form-actions button {
    flex: 1;
    padding: 9px 16px;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s;
}

/* 旧样式删除 */
.sync-add-server {
    display: none;
}

.sync-input-group {
    display: none;
}

.sync-server-list {
    display: none;
}

.sync-server-list h4 {
    display: none;
}

.sync-server-item {
    background: #ffffff;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.sync-server-item:hover {
    background: #f5f5f5;
    border-color: #0078d4;
}

.sync-server-info {
    flex: 1;
}

.sync-server-name {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    margin-bottom: 3px;
}

.sync-server-url {
    font-size: 11px;
    color: #666;
    font-family: 'Consolas', monospace;
}

.sync-server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.sync-status-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.sync-status-icon.synced {
    color: #107c10;
}

.sync-status-icon.syncing {
    color: #0078d4;
    animation: spin 1s linear infinite;
}

.sync-status-icon.error {
    color: #d13438;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-server-actions {
    display: flex;
    gap: 4px;
}

.sync-server-actions button {
    padding: 5px 10px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.sync-server-actions button:hover {
    background: #e5e5e5;
    border-color: #0078d4;
}

.sync-server-actions .btn-delete {
    color: #d13438;
}

.sync-server-actions .btn-delete:hover {
    background: #fde7e9;
    border-color: #d13438;
}

.sync-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(180deg, #f9f9f9 0%, #f0f0f0 100%);
    border-radius: 4px;
    border: 1px solid #d0d0d0;
}

.sync-current-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
}

.sync-file-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.sync-file-path {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: #0078d4;
    overflow: hidden;
}

.sync-file-path i {
    color: #0078d4;
    font-size: 13px;
    flex-shrink: 0;
}

.sync-file-path span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-file-path.empty span {
    color: #888;
    font-style: italic;
}

.sync-buttons-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-sync-now {
    flex: 2;
    padding: 11px 20px;
    background: #0078d4;
    border: none;
    color: #ffffff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-sync-now::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-sync-now:hover::before {
    left: 100%;
}

.btn-sync-now:hover {
    background: #005a9e;
}

.btn-sync-now:active {
    transform: scale(0.98);
}

.btn-sync-now:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.btn-sync-now:disabled::before {
    display: none;
}

.btn-sync-now i {
    font-size: 15px;
    transition: transform 0.3s;
}

.btn-sync-now:not(:disabled):hover i {
    transform: rotate(180deg);
}

.btn-sync-config {
    flex: 1;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    color: #333;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-sync-config:hover {
    background: #f0f0f0;
    border-color: #0078d4;
    color: #0078d4;
}

.btn-sync-config:active {
    transform: scale(0.98);
}

.btn-sync-config i {
    font-size: 13px;
}

.sync-actions button {
    padding: 10px 20px;
    font-size: 14px;
}

.sync-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
    padding: 8px 12px;
    background: #fff3cd;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    line-height: 1.5;
}

.sync-hint i {
    color: #ffc107;
    font-size: 13px;
    flex-shrink: 0;
}

/* ==================== 创建节点模态框样式 ==================== */
.node-template-card {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.node-template-card:hover {
    background: #333337;
    border-color: #007acc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.node-template-card.selected {
    background: #1e3a5f;
    border-color: #007acc;
}

.template-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.template-header i {
    font-size: 18px;
}

.template-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.template-description {
    color: #999;
    font-size: 12px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.template-preview {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    padding: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.template-preview code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
}

.node-template-card:hover .template-preview {
    border-color: #007acc;
}
