.trap-box {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}
.solution-box {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}
.best-practice-box {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}
.performance-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}
.code-comparison {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}
.code-comparison > div {
    flex: 1;
}
@media (max-width: 768px) {
    .code-comparison {
        flex-direction: column;
    }
}
.trap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.trap-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.trap-card h5 {
    color: #dc3545;
    margin-bottom: 15px;
}
.practice-list {
    counter-reset: practice-counter;
    list-style: none;
    padding-left: 0;
}
.practice-list li {
    counter-increment: practice-counter;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    position: relative;
}
.practice-list li:before {
    content: "实践 " counter(practice-counter);
    position: absolute;
    top: -12px;
    left: 20px;
    background: #28a745;
    color: white;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.bad-practice {
    background: linear-gradient(45deg, transparent 95%, #ff6b6b 95%);
}
.good-practice {
    background: linear-gradient(45deg, transparent 95%, #51cf66 95%);
}
.icon-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    margin-right: 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}
.icon-danger {
    background: #dc3545;
    color: white;
}
.icon-success {
    background: #28a745;
    color: white;
}
.icon-warning {
    background: #ffc107;
    color: black;
}
.icon-info {
    background: #17a2b8;
    color: white;
}
.performance-meter {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    margin: 10px 0;
    overflow: hidden;
}
.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #51cf66, #ffd43b);
    transition: width 0.5s;
}
.debug-tools {
    background: #f8f9fa;
    border: 2px dashed #6c757d;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}
.anti-patterns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}
@media (max-width: 768px) {
    .anti-patterns {
        grid-template-columns: 1fr;
    }
}
