/* 顶部菜单栏 */
.menu-bar {
    background: #252526;
    color: #d4d4d4;
    padding: 4px 8px;
    display: flex;
    gap: 8px;
    font-size: 13px;
    border-bottom: 1px solid #3c3c3c;
    align-items: center;
    position: relative;
    z-index: 100;
}

.menu-item {
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: #2a2d2e;
}

.menu-divider {
    width: 1px;
    height: 16px;
    background: #3c3c3c;
    margin: 0 4px;
}

/* 工具栏 */
.toolbar {
    background: #2d2d2d;
    border-bottom: 1px solid #3c3c3c;
    padding: 8px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.toolbar-button {
    background: #3c3c3c;
    color: #d4d4d4;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.toolbar-button:hover {
    background: #4c4c4c;
    color: #ffffff;
}

.toolbar-button.active {
    background: #0e639c;
    color: #ffffff;
}

/* 项目导航栏 */
.project-nav {
    width: 250px;
    background: #252526;
    border-right: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
}

.project-header {
    padding: 8px 12px;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    font-size: 13px;
    color: #d4d4d4;
}

.project-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-button {
    background: #0e639c;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    justify-content: center;
}

.action-button:hover {
    background: #1177bb;
}

.action-button:active {
    background: #0d5a8e;
}

.action-button .icon {
    font-size: 16px;
    line-height: 1;
}

/* 上传按钮样式 */
.upload-button {
    background: #0e639c;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    justify-content: center;
}

.upload-button:hover {
    background: #1177bb;
}

.upload-button:active {
    background: #0d5a8e;
}

.upload-button .icon {
    font-size: 16px;
    line-height: 1;
}

/* 文件树样式 */
.project-tree {
    background: #252526;
    color: #d4d4d4;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    font-size: 13px;
    user-select: none;
    border-right: 1px solid #3c3c3c;
}

.folder-item {
    padding: 4px 0;
}

.folder-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.folder-info:hover {
    background-color: #2a2d2e;
}

.folder-info.active {
    background-color: #37373d;
}

.folder-icon {
    display: flex;
    align-items: center;
    width: 24px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.folder-icon::before {
    content: '>';
    display: inline-block;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
    color: #d4d4d4;
    font-size: 14px;
    width: 14px;
    text-align: center;
}

.folder-icon::after {
    content: '';
    width: 20px;
    height: 18px;
    background: #d4d4d4;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14'%3E%3Cpath d='M14 4H8L6 2H2C1.45 2 1 2.45 1 3v8c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 14'%3E%3Cpath d='M14 4H8L6 2H2C1.45 2 1 2.45 1 3v8c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    margin-left: 2px;
}

.folder-item.expanded > .folder-info > .folder-icon::before {
    transform: rotate(90deg);
}

.folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 16px;
    display: none;
}

.folder-item.expanded > .file-list {
    display: block;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    margin: 2px 0;
}

.file-item:hover {
    background: #2a2d2e;
}

.file-item.active {
    background: #37373d;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-icon {
    font-family: monospace;
    font-size: 14px;
    color: #d4d4d4;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon.php {
    color: #6b7eb8;
}

.file-icon.php::before {
    content: '<?';
}

.file-icon.default {
    color: #d4d4d4;
}

.file-icon.default::before {
    content: '□';
}

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

.file-close {
    opacity: 0;
    color: #d4d4d4;
    padding: 0 4px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.file-item:hover .file-close {
    opacity: 1;
}

.file-close:hover {
    color: #ffffff;
    background: #3c3c3c;
    border-radius: 4px;
}

/* 编辑器容器样式 */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: #1e1e1e;
}

.editor-container:empty {
    display: none;
}

.editor-container:empty::before {
    content: '请选择或上传文件';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #808080;
    font-size: 14px;
}

/* 编辑区域 */
#editor {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Monaco Editor 自定义样式 */
.monaco-editor .margin {
    border-right: 1px solid #3c3c3c;
}

.monaco-editor .line-numbers {
    color: #858585;
}

.monaco-editor .current-line {
    border: none;
    background-color: rgba(255, 255, 255, 0.05);
}

.monaco-editor .margin-view-overlays .cgmr {
    border-right: 1px solid #3c3c3c;
}

.editor pre {
    margin: 0;
    padding: 0;
    background: none;
}

.editor code {
    font-family: 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* 底部状态栏 */
.status-bar {
    height: 28px;
    background: #252526;
    color: #d4d4d4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    user-select: none;
    border-top: 1px solid #3c3c3c;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: monospace;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-item {
    color: #d4d4d4;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: monospace;
}

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

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}

/* 标签页样式 */
.tabs {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    height: 35px;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.tab-list {
    display: flex;
    align-items: center;
    height: 100%;
    overflow-x: auto;
    flex: 1;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: 100%;
    background: #2d2d2d;
    border-right: 1px solid #333;
    cursor: pointer;
    user-select: none;
    min-width: 120px;
    max-width: none;
    gap: 8px;
}

.tab.active {
    background: #1e1e1e;
    border-bottom: 2px solid #007acc;
}

.tab-icon {
    font-size: 14px;
    line-height: 1;
}

.tab-title {
    flex: 1;
    font-size: 13px;
    color: #ccc;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.tab-close {
    margin-left: 4px;
    color: #666;
    font-size: 16px;
    line-height: 1;
    padding: 2px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

.tab:hover .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: #404040;
    color: #fff;
}

.tab.active .tab-title {
    color: #fff;
}

#editor {
    flex: 1;
    height: calc(100% - 35px);
}

.web-container {
    flex: 1;
    height: calc(100% - 35px);
    display: none;
    background: #fff;
}

.web-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.settings-container {
    padding: 20px;
    color: #333;
}

.settings-container h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #1e1e1e;
}

.settings-content {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Markdown 预览样式 */
.markdown-preview {
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #24292e;
    line-height: 1.6;
}

.markdown-content {
    max-width: 800px;
    margin: 0 auto;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-content h1 {
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.markdown-content p {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-content code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.markdown-content pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 3px;
    margin-bottom: 16px;
}

.markdown-content pre code {
    padding: 0;
    margin: 0;
    background-color: transparent;
    border: 0;
    word-break: normal;
    white-space: pre;
}

.markdown-content table {
    display: block;
    width: 100%;
    overflow: auto;
    margin-top: 0;
    margin-bottom: 16px;
    border-spacing: 0;
    border-collapse: collapse;
}

.markdown-content table th,
.markdown-content table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-content table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1;
}

.markdown-content table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.markdown-content blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px 0;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 2em;
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-content li {
    margin-top: 0.25em;
}

.markdown-content img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
}

.markdown-content hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

/* 分割线样式 */
.splitter {
    width: 4px;
    background: #3c3c3c;
    cursor: col-resize;
    transition: background-color 0.2s ease;
    position: relative;
    z-index: 10;
}

.splitter:hover {
    background: #0e639c;
}

.splitter::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #0e639c;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.splitter:hover::after {
    opacity: 1;
}

/* 工具提示样式 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #333333;
    color: #ffffff;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-tooltip]:after {
    content: '';
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333333 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
    opacity: 1;
    visibility: visible;
}

/* 空编辑器状态 */
.editor-container.empty-editor {
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.editor-container.empty-editor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #3c3c3c, transparent);
    opacity: 0.5;
}

.empty-editor-content {
    text-align: center;
    color: #808080;
    max-width: 600px;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease-out;
}

.empty-editor-title {
    font-size: 32px;
    margin-bottom: 24px;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empty-editor-description {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 32px;
    color: #d4d4d4;
    opacity: 0.9;
}

.empty-editor-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

.empty-editor-button {
    background: #2d2d2d;
    color: #ffffff;
    border: 1px solid #3c3c3c;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.empty-editor-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: 0.5s;
}

.empty-editor-button:hover {
    background: #3c3c3c;
    border-color: #4c4c4c;
    transform: translateY(-1px);
}

.empty-editor-button:hover::before {
    left: 100%;
}

.empty-editor-button:active {
    background: #252526;
    transform: translateY(1px);
}

.empty-editor-icon {
    font-size: 18px;
    line-height: 1;
    opacity: 0.9;
}

.empty-editor-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 40px;
    max-width: 800px;
    width: 100%;
}

.feature-item {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    transition: all 0.3s ease;
    border: 1px solid #3c3c3c;
}

.feature-item:hover {
    background: #3c3c3c;
    transform: translateY(-2px);
    border-color: #4c4c4c;
}

.feature-icon {
    font-size: 24px;
    color: #808080;
    margin-bottom: 12px;
}

.feature-title {
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 500;
}

.feature-description {
    color: #d4d4d4;
    font-size: 13px;
    line-height: 1.6;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 添加背景装饰 */
.editor-container.empty-editor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(60, 60, 60, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    position: absolute;
    color: #fff;
    font-size: 14px;
    margin-top: 70px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 确保编辑器容器有相对定位 */
.editor-container {
    position: relative;
}

.empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    height: 100%;
    background: #1e1e1e;
    color: #d4d4d4;
}

.empty-main-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.empty-main-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 40px;
    max-width: 600px;
}

.empty-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 800px;
    width: 100%;
}

.feature-box {
    background: #252526;
    border-radius: 8px;
    padding: 24px;
    text-align: left;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: #0e639c;
    background: #2d2d2d;
}

.feature-icon {
    font-size: 24px;
    color: #0e639c;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.5;
}

/* 编辑器局部加载动画 */
.editor-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 30, 30, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.editor-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #0e639c;
    border-radius: 50%;
    animation: editor-spin 1s linear infinite;
    position: relative;
}

.editor-loading-text {
    position: absolute;
    color: #fff;
    font-size: 14px;
    margin-top: 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes editor-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 确保编辑器容器有相对定位 */
#editor {
    position: relative !important;
} 