body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    padding: 20px;
    line-height: 1.5;
    color: #24292e;
    margin: 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

h1 {
    color: #4a4a4a;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.editor-container {
    position: relative;
    height: 500px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    margin-bottom: 20px;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 50px;
    background-color: #f6f8fa;
    border-right: 1px solid #e1e4e8;
    padding: 10px 0;
    text-align: right;
    user-select: none;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    color: #6e7781;
    overflow: hidden;
}

.line-numbers div {
    padding: 0 10px 0 0;
    line-height: 20px;
}

#editor, #highlight {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 50px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 20px;
    padding: 10px;
    margin: 0;
    border: none;
    width: calc(100% - 50px);
    height: 100%;
    box-sizing: border-box;
    overflow-x: hidden;       /* 隐藏水平滚动条 */
    overflow-y: auto;         /* 保留垂直滚动 */
    white-space: pre-wrap;    /* 关键属性: 允许文本换行 */
    word-wrap: break-word;    /* 确保长单词也能换行 */
}

#editor {
    color: transparent;
    caret-color: #000;
    background: transparent;
    z-index: 2;
    resize: none;
}

#highlight {
    z-index: 1;
    pointer-events: none;
    background-color: white;
}

.controls-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    flex: 1;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5da;
    background-color: #f6f8fa;
    color: #24292e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #e1e4e8;
}

.btn-primary {
    background-color: #0366d6;
    color: white;
    border-color: #0366d6;
}

.btn-primary:hover {
    background-color: #0256b9;
}

.config {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.config label {
    margin-right: 10px;
    font-size: 14px;
}

.config input {
    width: 50px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #d1d5da;
}

#dropZone {
    border: 2px dashed #d1d5da;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    background-color: #f6f8fa;
    cursor: pointer;
    transition: all 0.2s;
}

#dropZone:hover, #dropZone.drag-over {
    background-color: #e1e4e8;
    border-color: #0366d6;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    margin-bottom: 10px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease forwards;
}

.toast.success {
    background-color: #28a745;
    color: white;
}

.toast.error {
    background-color: #dc3545;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

#modalBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: none;
}

#shareModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#shareModal h3 {
    margin-top: 0;
    color: #4a4a4a;
    text-align: center;
}

#share-link {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d1d5da;
    margin-bottom: 15px;
    font-family: monospace;
}

.modal-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* GitHub-style syntax highlighting */
.token-comment {
    color: #6a737d;
}

.token-tag {
    color: #22863a;
}

.token-attribute {
    color: #6f42c1;
}

.token-string {
    color: #032f62;
}

.processing-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(52, 152, 219, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.processing-indicator.visible {
    opacity: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
    .editor-container {
        height: 400px;
    }

    .controls-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls {
        margin-bottom: 10px;
        width: 100%;
    }

    .btn {
        flex-grow: 1;
    }

    .config {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
    }
}