Files
mengyanote/mengyanote-backend/data/mengyanote/AI/提示词工程/前端开发/文档类前端网页模板.md
2026-05-16 19:03:44 +08:00

3.9 KiB

/* ===== 基础重置与全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== 布局系统 ===== */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.main-content {
    flex: 3;
    min-width: 300px;
}

.sidebar {
    flex: 1;
    min-width: 250px;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
}

/* ===== 卡片设计 ===== */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== 排版系统 ===== */
h1, h2, h3, h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 25px;
    color: #2980b9;
    font-size: 2.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #3498db;
    font-size: 1.8rem;
}

h3 {
    color: #2980b9;
    font-size: 1.4rem;
}

p {
    margin-bottom: 15px;
}

/* ===== 代码块样式 ===== */
.code-example {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    margin: 15px 0;
    overflow-x: auto;
    font-size: 0.9rem;
}

.tag {
    display: inline-block;
    background: #ecf0f1;
    color: #2c3e50;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9rem;
    margin: 0 3px;
}

.highlight {
    color: #e74c3c;
    font-weight: bold;
}

/* ===== UI组件 ===== */
.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    margin: 5px;
}

.btn:hover {
    background: #2980b9;
}

.alert {
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* ===== 演示区域样式 ===== */
.demo-box {
    border: 2px dashed #3498db;
    padding: 15px;
    margin: 15px 0;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.flex-container {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
}

.flex-item {
    background: #2ecc71;
    color: white;
    padding: 15px;
    border-radius: 5px;
    width: 30%;
    text-align: center;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.grid-item {
    background: #9b59b6;
    color: white;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

/* ===== 导航菜单 ===== */
.nav-menu {
    display: flex;
    background: #2c3e50;
    border-radius: 5px;
    overflow: hidden;
    margin: 15px 0;
}

.nav-item {
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.nav-item:hover {
    background: #3498db;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #7f8c8d;
    font-size: 0.9rem;
}