/**
 * 李氏家族网站 - 主样式文件
 */

:root {
    --family-primary: #8B4513;
    --family-secondary: #D2691E;
    --family-dark: #2F1810;
    --family-light: #F5F5DC;
    --family-success: #28A745;
    --family-warning: #FFC107;
    --family-danger: #DC3545;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    background-color: var(--family-light);
    color: #333;
    line-height: 1.6;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--family-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--family-secondary);
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, var(--family-primary), var(--family-secondary));
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white !important;
    transition: all 0.3s;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    transition: all 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: all 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

.nav-link.active::after {
    width: 100%;
}

/* 轮播图 */
.carousel {
    position: relative;
}

.carousel-item {
    height: 500px;
    overflow: hidden;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 8s ease;
}

.carousel-item:hover img {
    transform: scale(1.05);
}

.carousel-caption {
    background: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    bottom: 50px;
    left: 10%;
    right: 10%;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.5s forwards 0.3s;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 页面头部 */
.page-header {
    background: linear-gradient(135deg, var(--family-primary), var(--family-secondary));
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://via.placeholder.com/1920x1080/000000/FFFFFF?text=李氏家族') center/cover;
    opacity: 0.1;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

/* 按钮样式 */
.btn-family {
    background: linear-gradient(135deg, var(--family-primary), var(--family-secondary));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-family::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.6s;
}

.btn-family:hover::before {
    left: 100%;
}

.btn-family:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139,69,19,0.3);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-img-top {
    transition: transform 0.3s;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* 快速链接 */
.quick-link {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.quick-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139,69,19,0.1), transparent);
    transition: all 0.6s;
}

.quick-link:hover::before {
    left: 100%;
}

.quick-link:hover {
    background: linear-gradient(135deg, var(--family-primary), var(--family-secondary));
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(139,69,19,0.2);
    border-color: var(--family-primary);
}

.quick-link i {
    font-size: 2.5rem;
    color: var(--family-primary);
    margin-bottom: 15px;
    transition: all 0.3s;
}

.quick-link:hover i {
    color: white;
    transform: scale(1.1);
}

/* 公告项 */
.announcement-item {
    border-left: 3px solid var(--family-primary);
    padding-left: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
    background: white;
    padding: 15px;
    border-radius: 0 10px 10px 0;
}

.announcement-item:hover {
    background: rgba(139,69,19,0.1);
    padding-left: 20px;
    transform: translateX(5px);
}

/* 家训区域 */
.motto-section {
    background: linear-gradient(135deg, rgba(139,69,19,0.1), rgba(210,105,30,0.1));
    padding: 40px 0;
    margin: 40px 0;
    position: relative;
}

.motto-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://via.placeholder.com/1920x1080/8B4513/FFFFFF?text=家训') center/cover;
    opacity: 0.05;
}

/* 章节标题 */
.section-title {
    color: var(--family-primary);
    font-weight: bold;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--family-primary), var(--family-secondary));
    animation: expand 1s ease-in-out;
}

@keyframes expand {
    from {
        width: 0;
    }
    to {
        width: 80px;
    }
}

/* 页脚 */
.footer {
    background: var(--family-dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--family-primary), var(--family-secondary));
}

.footer h5 {
    color: var(--family-secondary);
    margin-bottom: 20px;
}

.footer a {
    color: #D2691E;
    text-decoration: none;
    transition: all 0.3s;
}

.footer a:hover {
    color: white;
    transform: translateX(3px);
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul li i {
    margin-right: 10px;
    color: var(--family-secondary);
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--family-light);
    border-top: 5px solid var(--family-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 图片懒加载 */
.lazy {
    opacity: 0;
    transition: opacity 0.5s;
}

.lazy.loaded {
    opacity: 1;
}

/* 地图卡片 */
.map-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 69, 19, 0.1);
}

.map-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.map-image {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.map-image:hover {
    transform: scale(1.02);
}

.map-image img {
    transition: all 0.3s ease;
}

.map-image:hover img {
    filter: brightness(1.05);
}

/* 信息发布栏目样式 */
.announcement-item {
    transition: all 0.3s ease;
}

.announcement-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.15) !important;
}

.announcement-item a {
    transition: all 0.3s ease;
}

.announcement-item a:hover {
    color: var(--family-secondary) !important;
    text-decoration: underline !important;
}

.announcement-header {
    position: relative;
}

.announcement-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--family-primary), transparent);
}

/* 响应式设计 */
@media (max-width: 768px) {

    .carousel-item {
        height: 300px;
    }
    
    .carousel-caption {
        bottom: 20px;
        padding: 15px;
    }
    
    .carousel-caption h5 {
        font-size: 1.2rem;
    }
    
    .page-header {
        padding: 40px 0;
    }
    
    .quick-link {
        margin-bottom: 20px;
    }
    
    .announcement-item {
        margin-bottom: 10px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .nav-link {
        padding: 10px 0;
    }
    
    .btn-family {
        padding: 10px 20px;
    }
}

@media (max-width: 576px) {
    .carousel-item {
        height: 200px;
    }
    
    .carousel-caption {
        bottom: 10px;
        padding: 10px;
    }
    
    .carousel-caption h5 {
        font-size: 1rem;
    }
    
    .page-header {
        padding: 30px 0;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .quick-link i {
        font-size: 2rem;
    }
    
    .quick-link h4 {
        font-size: 1.1rem;
    }
}

/* 滚动动画 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 工具类 */
.text-primary {
    color: var(--family-primary) !important;
}

.text-secondary {
    color: var(--family-secondary) !important;
}

.bg-primary {
    background-color: var(--family-primary) !important;
}

.bg-secondary {
    background-color: var(--family-secondary) !important;
}

.border-primary {
    border-color: var(--family-primary) !important;
}

/* 按钮动画 */
.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-animated:hover::after {
    width: 300px;
    height: 300px;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139,69,19,0.1), transparent);
    transition: all 0.6s;
}

.card-hover:hover::before {
    left: 100%;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选择文本样式 */
::selection {
    background: var(--family-primary);
    color: white;
}

::-moz-selection {
    background: var(--family-primary);
    color: white;
}
