* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/**
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}
    **/

/* -------------------------------旋转标签 + 微调位置 */
.mermaid .grid .tick text {
    transform-origin: 0 0;
    /* letter-spacing: -0.5px; 微调字间距 */
    transform: rotate(-35deg) !important;
    text-anchor: end !important;
    font-size: 11px !important;
}
/* 拉伸时间轴 */
/* .mermaid svg {
    transform: scaleX(1.4) !important;
} */
/* 统一任务条高度 */
/* .mermaid .task {
    height: 24px !important; 
} */

/* 方法 A：放大整个图表：放大 1.2 倍，从左上角放大、自动调整宽度和高度 */
/* .mermaid svg {
    transform: scale(1.2);    
    transform-origin: left top; 
    width: auto !important;
    height: auto !important;
} */

/* 方法 B：仅增加时间轴宽度 */
/* .mermaid .grid path {
    stroke-width: 0;
} */

/* 可选：增加底部边距，避免标签被裁剪 */
/* .mermaid svg {
    margin-bottom: 40px;
} */

/* ------------------------------------ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 20px; */
}

.container h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: #4778b8;
    color: white;
    border-radius: 8px;
}

.description {
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.88em;
    color: #555;
}


.chart-types {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    /* margin-bottom: 30px; */
}

.chart-types h2 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.chart-examples {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    padding: 10px;
    margin-bottom: 15px;
}

.chart-examples .chart-buttons {
    gap: 6px;
}

.chart-examples .chart-btn {
    padding: 4px 8px;
    font-size: 14px;
    border: 1px solid #d1e5ff;
    color: #3d6aae;
    font-weight: 500;
}

.chart-examples .chart-btn:hover {
    background-color: #f0f7ff;
    color: #6ea6ff;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.15);
}

.chart-examples .chart-btn.active {
    background-color: #6ea6ff;
    color: white;
    border-color: #6ea6ff;
}

.chart-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.chart-btn {
    padding: 10px 20px;
    border: 2px solid #3498db;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    background-color: white;
    color: #3498db;
}

.chart-btn:hover {
    background-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.chart-btn.active {
    background-color: #3498db;
    color: white;
}

.editor-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
}

.input-section {
    flex: 2;
    min-width: 300px;
    max-width: 500px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.preview-section {
    flex: 3;
    min-width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 输入区域的section-header特殊样式 */
.input-section .section-header {
    justify-content: space-between;
}

.input-section .section-header h2 {
    flex: 1;
}

/* 预览区域的section-header特殊样式 */
.preview-section .section-header {
    justify-content: space-between;
}

/* 确保主题选择器在中间 */
@media (min-width: 768px) {
    .preview-section .section-header h2 {
        flex: 0 0 auto;
    }
    
    .theme-selector {
        flex: 1;
        justify-content: center;
        margin: 0 auto;
    }
    
    .section-header button {
        flex: 0 0 auto;
    }
}

.section-header h2 {
    color: #34495e;
    font-size: 1.5em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin: 0;
}

.theme-selector {
    display: flex;
    gap: 8px;
    margin: 0 10px;
    align-items: center;
}

.theme-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-circle:hover {
    transform: scale(1.2);
    border-color: #3498db;
}

.theme-circle.active {
    border-color: white;
    box-shadow: 0 0 0 2px #3498db;
}

#mermaid-input {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background-color: #e6f9e6;
    overflow: auto;
    flex-grow: 1;
}

#mermaid-input:focus {
    outline: none;
    border-color: #3498db;
    background-color: #d9f2d9;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* toolbar removed, buttons now in section-header */

.editor-container button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

#zoom-btn {
    background-color: #9b59b6;
    color: white;
    margin-right: 10px;
}

#zoom-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(155, 89, 182, 0.3);
}

#download-btn {
    background-color: #27ae60;
    color: white;
}

#download-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

#copy-btn {
    background-color: #f39c12;
    color: white;
    margin-right: 10px;
}

#copy-btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

#clear-btn {
    background-color: #e74c3c;
    color: white;
}

#clear-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

#mermaid-preview {
    width: 100%;
    height: 600px;
    min-height: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    background-color: #fff;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.mermaid {
    font-family: 'Arial', sans-serif;
    display: block;
    overflow: visible;
    min-width: 100%;
    margin: 5px auto;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
    overflow: visible;
}

/* 甘特图特定样式 */
.mermaid .taskText,
.mermaid .sectionText,
.mermaid .tickText {
    font-size: 16px !important;
    fill: #333 !important;
    font-weight: normal !important;
}

.mermaid .grid .tick {
    stroke: #e0e0e0;
    opacity: 0.8;
}

.mermaid .grid path.domain {
    stroke: #ccc;
    stroke-width: 1;
}

/* 自定义提示框样式 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #27ae60;
}

.toast.error {
    background-color: #e74c3c;
}

.toast.warning {
    background-color: #f39c12;
}

@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
    }
    
    .input-section,
    .preview-section {
        max-width: 100%;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}