/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-bottom: 60px;
    background-image: linear-gradient(135deg, #f5f7fa 25%, #e9ecef 25%, #e9ecef 50%, #f5f7fa 50%, #f5f7fa 75%, #e9ecef 75%, #e9ecef 100%);
    background-size: 20px 20px;
    animation: backgroundMove 60s linear infinite;
}

@keyframes backgroundMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

header {
    background: linear-gradient(135deg, #ff9e7d 0%, #ff6b6b 100%);
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header p {
    font-size: 1.3rem;
    opacity: 0.95;
    position: relative;
    animation: fadeInUp 1s ease-out 0.3s both;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 3rem;
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

section h2 {
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff9e7d, transparent);
}

footer {
    background: linear-gradient(135deg, #333 0%, #444 100%);
    color: white;
    text-align: center;
    padding: 1.2rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* 树形结构样式 */
.tree-container {
    background-color: white;
}

#cat-tree {
    font-size: 1.1rem;
    line-height: 2;
}

.tree-item {
    padding-left: 2rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 5px;
    padding: 0.5rem 0 0.5rem 2rem;
}

.tree-item::before {
    content: '🐾';
    position: absolute;
    left: 0.5rem;
    transition: transform 0.3s ease;
    font-size: 1rem;
}

.tree-item.collapsed::before {
    transform: rotate(-90deg);
}

.tree-children {
    margin-left: 1rem;
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tree-item:hover {
    color: #ff6b6b;
    background-color: #fff5f5;
    transform: translateX(5px);
}

/* 名片容器样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.cat-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: #333;
    border: 1px solid #f0f0f0;
}

.cat-card:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: #ffccbc;
}

.cat-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.cat-card:hover img {
    transform: scale(1.05);
}

.cat-card-content {
    padding: 1.5rem;
}

.cat-card h3 {
    color: #ff6b6b;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    transition: color 0.3s ease;
}

.cat-card:hover h3 {
    color: #ff8e7d;
}

.cat-card p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.8rem;
    transition: color 0.3s ease;
}

.cat-card:hover p {
    color: #444;
}

/* 时间轴样式 */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background: linear-gradient(to bottom, #ff9e7d, #ff6b6b);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 3px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    animation: fadeInUp 0.8s ease-out both;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border: 4px solid #ff6b6b;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-item:hover::before {
    transform: translateY(-50%) scale(1.2);
    background-color: #ff6b6b;
    border-color: white;
}

.timeline-item-content {
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-item-content {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transform: scale(1.03);
}

.timeline-item img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.timeline-item:hover img {
    transform: scale(1.02);
}

.timeline-date {
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: inline-block;
    background-color: #fff5f5;
    padding: 5px 10px;
    border-radius: 20px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    section h2 {
        font-size: 1.8rem;
    }
    
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0%;
    }
    
    .timeline-item::before {
        left: 21px !important;
        right: auto !important;
    }
    
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .cat-card img {
        height: 200px;
    }
    
    .cat-card h3 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    section {
        padding: 1.2rem;
        margin-bottom: 2rem;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    .card-container {
        grid-template-columns: 1fr;
    }
    
    .cat-card img {
        height: 180px;
    }
    
    .cat-card h3 {
        font-size: 1.5rem;
    }
    
    .timeline-item {
        padding-left: 60px;
        padding-right: 15px;
    }
    
    .timeline-item::before {
        left: 16px !important;
        width: 16px;
        height: 16px;
    }
    
    .timeline-date {
        font-size: 1rem;
    }
}