* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}



.btn-outline {
    background: transparent;
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
}

.btn-outline:hover {
    background: #ff6b6b;
    color: white;
}

.select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.editor-section, .result-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h3 {
    color: #333;
    font-size: 1.2rem;
    margin: 0;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.drag-hint {
    font-size: 12px;
    color: #6c757d;
}

.editor-container {
    height: 500px;
    position: relative;
}

#yamlInput {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 20px;
    resize: none;
}

.CodeMirror {
    height: 100% !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.status-icon.ready {
    background: #28a745;
}

.status-icon.error {
    background: #dc3545;
}

.status-icon.processing {
    background: #ffc107;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.result-container {
    height: 500px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.output-area {
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    flex: 1;
    min-height: 0;
}

.error-panel {
    padding: 20px;
    background: #f8d7da;
    border-top: 1px solid #f5c6cb;
    flex-shrink: 0;
    max-height: 300px;
    overflow-y: auto;
    border-left: 4px solid #dc3545;
    margin-top: 10px;
    display: block;
}

.error-panel.hidden {
    display: none !important;
}

.error-panel h4 {
    color: #721c24;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.error-item {
    background: white;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    color: #721c24;
}

.error-message {
    margin-bottom: 8px;
    line-height: 1.4;
}

.error-location {
    margin-bottom: 8px;
    color: #dc3545;
    font-weight: 500;
}

.error-suggestion {
    margin-top: 8px;
    padding: 8px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.fix-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
}

.manual-fix-guide {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.manual-fix-guide ul {
    margin: 0;
    padding-left: 20px;
}

.manual-fix-guide li {
    margin: 5px 0;
    color: #495057;
}

.diff-content {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.diff-line {
    margin: 2px 0;
    line-height: 1.4;
}

.diff-original {
    color: #dc3545;
    background: #ffe6e6;
    padding: 1px 4px;
    border-radius: 2px;
}

.diff-fixed {
    color: #28a745;
    background: #e6ffe6;
    padding: 1px 4px;
    border-radius: 2px;
}

/* 错误行高亮 */
.error-line {
    background-color: #ffe6e6 !important;
    border-left: 3px solid #dc3545 !important;
}

/* 错误字符高亮 */
.error-char {
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 2px;
    padding: 1px 2px;
}

.info-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.info-item h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-item ul {
    list-style: none;
    padding: 0;
}

.info-item li {
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    color: #6c757d;
    position: relative;
    padding-left: 20px;
}

.info-item li:before {
    content: "•";
    color: #ff6b6b;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.modal {
    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: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

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

.modal-body {
    padding: 20px;
}

.share-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.share-link {
    display: flex;
    gap: 10px;
}

.share-link input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
    
    .editor-container, .result-container {
        height: 400px;
    }
}
