/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f6f6f6;
    line-height: 1.6;
    color: #333;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
    height: calc(100vh - 40px);
}

/* 文件面板 */
.file-panel {
    width: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: #bbbbbb #f6f6f6;
}

.file-panel::-webkit-scrollbar {
    width: 8px;
}

.file-panel::-webkit-scrollbar-track {
    background: #f6f6f6;
    border-radius: 4px;
}

.file-panel::-webkit-scrollbar-thumb {
    background: #bbbbbb;
    border-radius: 4px;
    transition: background 0.2s;
}

.file-panel::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

.file-panel h2 {
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.open-local-btn {
    width: 100%;
    padding: 10px 12px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.open-local-btn:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list li {
    margin: 8px 0;
}

.file-list a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-list a:hover {
    background: #f0f7ff;
    color: #2c82ff;
    text-decoration: none;
}

.file-list a.active {
    background: #2c82ff;
    color: #fff;
}

/* 右侧面板 */
.right-panel {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.right-panel::-webkit-scrollbar {
    width: 8px;
}

.right-panel::-webkit-scrollbar-track {
    background: #f6f6f6;
    border-radius: 4px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: #bbbbbb;
    border-radius: 4px;
    transition: background 0.2s;
}

.right-panel::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

.right-panel {
    scrollbar-width: thin;
    scrollbar-color: #bbbbbb #f6f6f6;
}

/* 代码块滚动条 */
pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #f6f6f6;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: #bbbbbb;
    border-radius: 4px;
    transition: background 0.2s;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

pre {
    scrollbar-width: thin;
    scrollbar-color: #bbbbbb #f6f6f6;
}

/* Markdown 样式 */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin: 1.5em 0 0.5em;
    font-weight: 600;
}

h1 { font-size: 26px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; color: #777; }

blockquote {
    margin: 1em 0;
    padding: 10px 15px;
    background: #f9f9f9;
    border-left: 4px solid #2c82ff;
    color: #555;
    border-radius: 4px;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

blockquote p { margin: 0; }

ul, ol {
    padding-left: 24px;
    margin: 1em 0;
}

ul li {
    list-style: none;
    position: relative;
}

ol li { margin: 5px 0; }

code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e96900;
    font-size: 0.9em;
}

pre {
    position: relative;
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    background: #444;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #666;
}

p { margin: 1.2em 0; }

a { color: #2c82ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.error { color: #e74c3c; padding: 10px; }

img {
    max-width: 100%;
}

.loading {
    color: #888;
    text-align: center;
    padding: 20px;
}

/* 按钮样式 */
.toggle-btn {
    padding: 8px 16px;
    background: #2c82ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: #1a6fe8;
    transform: translateY(-1px);
}

.toggle-btn.active {
    background: #e74c3c;
}

.toggle-btn.active:hover {
    background: #c0392b;
}

.save-btn {
    padding: 8px 16px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.save-btn:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.save-btn.saved {
    background: #95a5a6;
}

.new-btn {
    padding: 8px 16px;
    background: #9b59b6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.new-btn:hover {
    background: #8e44ad;
    transform: translateY(-1px);
}

.delete-btn {
    padding: 8px 16px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-group {
    position: sticky;
    top: -20px;
    right: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 15px;
    margin: -20px -20px 0 -20px;
    background: #fff;
    z-index: 10;
}

.content-area {
    margin-top: 20px;
}

.editor-textarea {
    width: 100%;
    height: calc(100% - 70px);
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.editor-textarea:focus {
    border-color: #2c82ff;
    box-shadow: 0 0 0 3px rgba(44, 130, 255, 0.1);
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    min-width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #2c3e50;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: #2c82ff;
    box-shadow: 0 0 0 3px rgba(44, 130, 255, 0.1);
}

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

.modal-cancel-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.modal-cancel-btn:hover {
    background: #e0e0e0;
}

.modal-confirm-btn {
    padding: 8px 16px;
    background: #2c82ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.modal-confirm-btn:hover {
    background: #1a6fe8;
}

.modal-confirm-btn.danger {
    background: #e74c3c;
}

.modal-confirm-btn.danger:hover {
    background: #c0392b;
}

.confirm-message {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}
