.lifecycle-diagram {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    border: 3px solid #e9ecef;
    position: relative;
    overflow: hidden;
}
.lifecycle-diagram::before {
    content: '生命周期流程图';
    position: absolute;
    top: -15px;
    left: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}
.lifecycle-flow {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 20px 0;
    position: relative;
}
.phase-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 22%;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}
.phase-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.phase-box.initiation {
    border-top: 4px solid #667eea;
}
.phase-box.mounting {
    border-top: 4px solid #38c172;
}
.phase-box.updating {
    border-top: 4px solid #f6993f;
}
.phase-box.destruction {
    border-top: 4px solid #e3342f;
}
.phase-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}
.phase-connector {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #38c172, #f6993f, #e3342f);
    z-index: 0;
}
.hook-timeline {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 5px solid #667eea;
}
.timeline-item {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
}
.timeline-number {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 20px;
    flex-shrink: 0;
}
.code-example {
    background-color: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
    position: relative;
}
.hook-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 25px 0;
}
.hook-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
}
.hook-table tr:hover {
    background-color: #f8f9fa;
}
.hook-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin: 2px;
}
.badge-creation { background: #e3f2fd; color: #1565c0; }
.badge-mounting { background: #e8f5e9; color: #2e7d32; }
.badge-updating { background: #fff3e0; color: #ef6c00; }
.badge-destruction { background: #ffebee; color: #c62828; }
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 25px 0;
}
.comparison-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-top: 4px solid #667eea;
}
.warning-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
}
.tip-box {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
}
.practice-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
}
.hook-demo {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
    border: 2px solid #e9ecef;
}
.interactive-demo {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.lifecycle-steps {
    counter-reset: step;
    margin: 30px 0;
}
.step {
    position: relative;
    padding-left: 60px;
    margin-bottom: 30px;
    min-height: 50px;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}
.phase-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    background: #667eea;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    margin-right: 10px;
}
