Files
SmartChat/static/css/markdown.css
2026-01-08 01:06:27 +08:00

275 lines
5.1 KiB
CSS

:root {
--primary-color: #2c3e50;
--secondary-color: #3498db;
--accent-color: #e74c3c;
--light-bg: #f8f9fa;
--dark-bg: #2c3e50;
--text-color: #333;
--border-color: #e0e0e0;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
* {
margin: 5px;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
max-width: 1400px;
margin: 0 auto;
padding: 20px;
line-height: 1.6;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
}
.header {
text-align: center;
margin-bottom: 30px;
color: white;
}
.header h1 {
font-size: 2.5rem;
margin-bottom: 10px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.header p {
font-size: 1.1rem;
opacity: 0.9;
}
.main-content {
background: white;
border-radius: 15px;
padding: 30px;
box-shadow: var(--shadow);
margin-bottom: 30px;
}
.container {
display: flex;
gap: 30px;
margin-bottom: 40px;
}
.editor, .preview {
flex: 1;
border: 2px solid var(--border-color);
padding: 25px;
border-radius: 10px;
background: white;
transition: all 0.3s ease;
}
.editor:hover, .preview:hover {
border-color: var(--secondary-color);
box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}
.editor h3, .preview h3 {
color: var(--primary-color);
margin-bottom: 15px;
font-size: 1.3rem;
border-bottom: 2px solid var(--secondary-color);
padding-bottom: 10px;
}
textarea {
width: 100%;
height: 400px;
font-family: 'Fira Code', 'Courier New', monospace;
font-size: 14px;
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 15px;
resize: vertical;
transition: all 0.3s ease;
background: #fafafa;
}
textarea:focus {
outline: none;
border-color: var(--secondary-color);
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
background: white;
}
.toolbar {
margin-top: 20px;
display: flex;
gap: 10px;
flex-wrap: wrap;
}
button {
padding: 12px 24px;
background: linear-gradient(135deg, var(--secondary-color), #2980b9);
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
transition: all 0.3s ease;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}
button:active {
transform: translateY(0);
}
#htmlPreview {
min-height: 400px;
padding: 15px;
border: 1px solid var(--border-color);
border-radius: 8px;
background: #fafafa;
overflow-y: auto;
}
#htmlPreview::-webkit-scrollbar {
display: none;
}
.syntax-guide {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.guide-card {
background: var(--light-bg);
padding: 20px;
border-radius: 10px;
border-left: 4px solid var(--secondary-color);
}
.guide-card h3 {
color: var(--primary-color);
margin-bottom: 15px;
font-size: 1.2rem;
}
.syntax {
background: #2c3e50;
color: white;
padding: 8px 12px;
border-radius: 5px;
font-family: 'Fira Code', monospace;
font-size: 13px;
margin: 5px 0;
display: inline-block;
}
@keyframes slideIn {
from {
transform: translateY(-10px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
/* Blockquote 样式 - 注释样式,字体变小,颜色变灰 */
blockquote {
background: linear-gradient(135deg, #f8f9fa, #e9ecef);
border-left: 4px solid #6c757d;
margin: 20px 0;
padding: 15px 20px;
font-size: 0.9em;
color: #6c757d;
font-style: italic;
border-radius: 0 8px 8px 0;
position: relative;
}
blockquote::before {
content: "❝";
font-size: 2em;
color: #adb5bd;
position: absolute;
left: 10px;
top: 5px;
opacity: 0.5;
}
blockquote p {
margin: 0;
line-height: 1.5;
}
/* CodeBlock 样式 - 更鲜艳的样式 */
pre {
background: linear-gradient(135deg, #2d3748, #4a5568);
border: 1px solid #4a5568;
border-radius: 8px;
padding: 20px;
margin: 20px 0;
overflow-x: auto;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
position: relative;
white-space: pre;
font-family: 'Fira Code', monospace;
font-size: 13px;
line-height: 1.4;
color: #e2e8f0;
}
pre::before {
content: "</>";
position: absolute;
top: 10px;
right: 15px;
color: #81e6d9;
font-size: 0.8em;
font-weight: bold;
opacity: 0.7;
}
/* 行内代码样式 */
:not(pre) > code {
background: linear-gradient(135deg, #fed7e2, #fbb6ce);
color: #702459;
padding: 2px 6px;
border-radius: 4px;
line-height: 1.4;
border: 1px solid #fbb6ce;
}
.footer {
text-align: center;
color: white;
margin-top: 30px;
opacity: 0.8;
}
@media (max-width: 768px) {
.container {
flex-direction: column;
}
.syntax-guide {
grid-template-columns: 1fr;
}
.header h1 {
font-size: 2rem;
}
}