:root {
    --django-green: #0C4B33;
    --django-light-green: #44B78B;
    --django-dark-green: #082E20;
    --security-red: #dc3545;
    --security-orange: #fd7e14;
    --security-yellow: #ffc107;
    --security-green: #28a745;
    --security-blue: #007bff;
}

.bg-django {
    background-color: var(--django-green) !important;
}

.text-django {
    color: var(--django-green) !important;
}

.btn-django {
    background-color: var(--django-green);
    color: white;
}

.btn-django:hover {
    background-color: var(--django-dark-green);
    color: white;
}

.hero-section {
    background: linear-gradient(135deg, var(--django-green) 0%, var(--django-light-green) 100%);
    color: white;
    padding: 3rem 0;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background-color: var(--django-light-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.card-hover {
    transition: transform 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
}

.code-block {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

.chapter-title {
    border-bottom: 2px solid var(--django-green);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.navbar-brand img {
    filter: brightness(0) invert(1);
}

.template-example {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin: 20px 0;
}

.template-example .example-header {
    background-color: #e9ecef;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
}

.template-example .example-content {
    padding: 15px;
}

.template-diagram {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.template-diagram .diagram-item {
    display: inline-block;
    margin: 10px;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 150px;
}

.template-diagram .arrow {
    font-size: 24px;
    color: var(--django-green);
    margin: 0 10px;
}

.badge-django {
    background-color: var(--django-green);
    color: white;
}

/* 安全特定样式 */
.security-level {
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
}

.level-critical { background-color: var(--security-red); color: white; }
.level-high { background-color: var(--security-orange); color: white; }
.level-medium { background-color: var(--security-yellow); color: black; }
.level-low { background-color: var(--security-green); color: white; }
.level-info { background-color: var(--security-blue); color: white; }

.security-checklist {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    background-color: white;
}

.checklist-item.checked {
    border-left: 4px solid var(--security-green);
}

.checklist-item.unchecked {
    border-left: 4px solid var(--security-yellow);
}

.checklist-icon {
    margin-right: 15px;
    font-size: 1.2rem;
}

.attack-flow {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.attack-step {
    text-align: center;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    margin: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.attack-step.malicious {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.security-table th {
    background-color: var(--django-green);
    color: white;
}

.security-alert {
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid;
}

.alert-critical {
    background-color: #f8d7da;
    border-left-color: var(--security-red);
    color: #721c24;
}
.alert-high {
    background-color: #fff3cd;
    border-left-color: var(--security-yellow);
    color: #856404;
}
.alert-medium {
    background-color: #d1ecf1;
    border-left-color: var(--security-blue);
    color: #0c5460;
}
.alert-low {
    background-color: #d4edda;
    border-left-color: var(--security-green);
    color: #155724;
}

.security-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 5px;
    background-color: #6c757d;
    color: white;
}

.badge-csrf { background-color: #007bff; }
.badge-xss { background-color: #28a745; }
.badge-sql { background-color: #17a2b8; }
.badge-clickjacking { background-color: #6f42c1; }
.badge-auth { background-color: #e83e8c; }
.badge-data { background-color: #fd7e14; }

.copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.copy-btn:hover {
    opacity: 1;
}

/* 配置表格样式 */
.config-table {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.config-table code {
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
}
