/**
 * Lemonx Compatibility Styles for Frontend
 * 用于在任何主题中确保 Lemonx 编辑的内容正确显示
 */

/* ========================================
   基础文本样式
   ======================================== */

.lemonx-visual-root,
body .lemonx-visual-root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* ========================================
   标题
   ======================================== */

.lemonx-visual-root h1,
.lemonx-visual-root h2,
.lemonx-visual-root h3,
.lemonx-visual-root h4,
.lemonx-visual-root h5,
.lemonx-visual-root h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.2;
    color: #111;
}

.lemonx-visual-root h1 { font-size: 2.5rem; }
.lemonx-visual-root h2 { font-size: 2rem; }
.lemonx-visual-root h3 { font-size: 1.75rem; }
.lemonx-visual-root h4 { font-size: 1.5rem; }
.lemonx-visual-root h5 { font-size: 1.25rem; }
.lemonx-visual-root h6 { font-size: 1rem; }

/* ========================================
   段落和基础元素
   ======================================== */

.lemonx-visual-root p {
    margin-bottom: 1em;
    line-height: 1.8;
}

.lemonx-visual-root a {
    color: #10b981;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lemonx-visual-root a:hover {
    color: #059669;
    text-decoration: underline;
}

/* ========================================
   列表
   ======================================== */

.lemonx-visual-root ul,
.lemonx-visual-root ol {
    margin: 0 0 1.5rem 1.5rem;
    padding: 0;
}

.lemonx-visual-root li {
    margin-bottom: 0.5rem;
}

/* ========================================
   图片
   ======================================== */

.lemonx-visual-root img {
    max-width: 100%;
    height: auto;
    display: block;
}

.lemonx-visual-root figure {
    margin: 1.5rem 0;
}

.lemonx-visual-root figcaption {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

/* ========================================
   代码
   ======================================== */

.lemonx-visual-root code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.lemonx-visual-root pre {
    background-color: #f4f4f4;
    border-left: 4px solid #10b981;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.lemonx-visual-root pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

/* ========================================
   引用
   ======================================== */

.lemonx-visual-root blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #10b981;
    background-color: #f9fafb;
    font-style: italic;
    color: #666;
}

/* ========================================
   表格
   ======================================== */

.lemonx-visual-root table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.lemonx-visual-root table th,
.lemonx-visual-root table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.lemonx-visual-root table th {
    background-color: #f4f4f4;
    font-weight: 600;
}

/* ========================================
   分隔线
   ======================================== */

.lemonx-visual-root hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 2rem 0;
}

/* ========================================
   按钮
   ======================================== */

.lemonx-visual-root button,
.lemonx-visual-root .lemonx-btn,
.lemonx-visual-root input[type="button"],
.lemonx-visual-root input[type="submit"] {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #10b981;
    color: white;
    transition: background-color 0.2s ease;
}

.lemonx-visual-root button:hover,
.lemonx-visual-root .lemonx-btn:hover,
.lemonx-visual-root input[type="button"]:hover,
.lemonx-visual-root input[type="submit"]:hover {
    background-color: #059669;
}

/* ========================================
   响应式
   ======================================== */

@media (max-width: 768px) {
    .lemonx-visual-root h1 { font-size: 2rem; }
    .lemonx-visual-root h2 { font-size: 1.75rem; }
    .lemonx-visual-root h3 { font-size: 1.5rem; }
    .lemonx-visual-root h4 { font-size: 1.25rem; }
    .lemonx-visual-root h5 { font-size: 1.125rem; }
    .lemonx-visual-root h6 { font-size: 1rem; }
}

