/**
 * 首页专用样式
 */

/* ========== Hero ========== */
.home-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #5a3a1a 40%, #3d2200 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    isolation: isolate;
}
.home-hero-bg {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay, rgba(20,15,10,0.55));
    z-index: 1;
    pointer-events: none;
}
.home-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(transparent, rgba(255,255,255,0.03));
    z-index: 1;
    pointer-events: none;
}

/* ===== 轮播 ===== */
.hero-slider {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.slide-item {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.slide-item.active { opacity: 1; }
.slide-content {
    position: absolute;
    bottom: 100px;
    left: 10%;
    right: 10%;
    text-align: center;
    color: #fff;
    z-index: 2;
}
.slide-content h2 { font-size: 32px; margin: 0 0 8px; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.slide-content p  { font-size: 16px; opacity: 0.9; text-shadow: 0 1px 8px rgba(0,0,0,0.5); }
.slide-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}
.slide-dots .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s;
}
.slide-dots .dot.active { background: #fff; width: 28px; border-radius: 5px; }
.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 36px;
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    transition: background 0.3s;
}
.slide-arrow:hover { background: rgba(255,255,255,0.35); }
.slide-prev { left: 20px; }
.slide-next { right: 20px; }

/* ===== Hero 内容 ===== */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 60px 20px;
}
.hero-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 3px;
    margin: 0 0 16px;
    text-shadow: 0 3px 20px rgba(0,0,0,0.5);
}
.hero-subtitle {
    font-size: 17px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* 搜索框 */
.hero-search { max-width: 560px; margin: 0 auto; }
.search-form-hero {
    display: flex;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.search-input-hero {
    flex: 1;
    padding: 15px 24px;
    border: none;
    font-size: 15px;
    outline: none;
    color: #333;
    background: transparent;
}
.search-btn-hero {
    padding: 15px 28px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
.search-btn-hero:hover { filter: brightness(1.1); }

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.hero-tag {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.25s;
    backdrop-filter: blur(4px);
}
.hero-tag:hover { background: rgba(255,255,255,0.3); }

/* ========== 共享标题 ========== */
.section-title {
    font-size: 26px;
    text-align: center;
    color: #222;
    margin: 0 0 40px;
    position: relative;
    font-weight: 700;
}
.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 32px;
}
.section-header-flex .section-title { margin: 0; }
.section-header-flex .section-title::after { margin: 12px 0 0; }
.section-more { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: bold; }
.section-more:hover { text-decoration: underline; }

/* ========== 统计数字 ========== */
.home-stats {
    padding: 60px 0;
    background: #faf8f5;
}
.stats-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.stat-item {
    text-align: center;
    padding: 20px 32px;
}
.stat-num {
    font-size: 40px;
    font-weight: 800;
    color: var(--accent);
    display: block;
}
.stat-label {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
}

/* ========== 功能卡片 ========== */
.home-features {
    padding: 70px 0;
    background: #fff;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.feature-card {
    display: block;
    text-align: center;
    padding: 36px 24px 30px;
    border-radius: 12px;
    background: #faf8f5;
    border: 1px solid transparent;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}
.feature-card:hover {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}
.feature-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    margin-bottom: 20px;
}
.feature-card h3 { font-size: 18px; margin: 0 0 8px; }
.feature-card p  { font-size: 13px; color: #999; margin: 0; line-height: 1.5; }

/* ========== 文章区 ========== */
.home-articles {
    padding: 70px 0;
    background: #faf8f5;
}
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.article-item {
    display: flex;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border: 1px solid #eee;
}
.article-item:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--accent);
}
.article-thumb {
    width: 140px;
    min-height: 120px;
    flex-shrink: 0;
    background: #f0e8d8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-info {
    flex: 1;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}
.article-cat {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background: #fdf7ee;
    color: #8B6914;
    border-radius: 3px;
    margin-bottom: 6px;
    align-self: flex-start;
}
.article-title {
    font-size: 16px;
    margin: 0 0 6px;
    line-height: 1.4;
}
.article-desc {
    font-size: 13px;
    color: #999;
    margin: 0;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-date {
    font-size: 12px;
    color: #ccc;
    margin-top: auto;
    padding-top: 8px;
}

/* ========== 精选家谱 ========== */
.home-families {
    padding: 60px 0;
    background: #fff;
}
.families-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.families-scroll::-webkit-scrollbar { height: 4px; }
.families-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
.family-mini-card {
    flex: 0 0 160px;
    text-decoration: none;
    color: #333;
    scroll-snap-align: start;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    background: #fff;
}
.family-mini-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.family-mini-cover {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, var(--primary), #5a3a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.family-mini-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.family-mini-surname {
    font-size: 40px;
    color: rgba(255,255,255,0.85);
    font-weight: bold;
}
.family-mini-info {
    padding: 12px 14px;
}
.family-mini-info strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.family-mini-info span {
    font-size: 11px;
    color: #aaa;
}

/* ========== 动画 ========== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeUp {
    animation: fadeUp 0.8s ease forwards;
}
.animate-fadeUp:nth-child(2) { animation-delay: 0.15s; }
.animate-fadeUp:nth-child(3) { animation-delay: 0.3s; }

/* ========== 网站介绍区 ========== */
.home-about {
    padding: 70px 0;
    background: #fff;
}
.about-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 2;
    color: #555;
    text-align: center;
}
.about-content p {
    margin: 0 0 16px;
    text-indent: 0;
}
.about-content strong {
    color: #333;
}

/* ========== 核心价值观 ========== */
.home-values {
    padding: 70px 0;
    background: linear-gradient(135deg, #faf8f5 0%, #f5ede0 50%, #faf8f5 100%);
}
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.value-card {
    background: #fff;
    border-radius: 14px;
    padding: 32px 24px;
    text-align: center;
    border: 1px solid #eee;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}
.value-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), #e74c3c);
    opacity: 0;
    transition: opacity 0.3s;
}
.value-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    border-color: var(--accent);
}
.value-card:hover::before { opacity: 1; }
.value-icon {
    font-size: 52px;
    margin-bottom: 16px;
    display: inline-block;
    transition: transform 0.35s ease;
    line-height: 1;
}
.value-card:hover .value-icon {
    transform: scale(1.15);
}
.value-title {
    font-size: 18px;
    margin: 0 0 12px;
    color: #333;
}
.value-desc {
    font-size: 14px;
    color: #888;
    line-height: 1.8;
    margin: 0;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .home-hero { min-height: 420px; }
    .hero-title { font-size: 32px; letter-spacing: 1px; }
    .hero-subtitle { font-size: 15px; }
    .feature-card { padding: 28px 16px 22px; }
    .feature-icon-wrap { width: 56px; height: 56px; }
    .articles-grid { grid-template-columns: 1fr; }
    .stat-num { font-size: 30px; }
    .stats-row { gap: 24px; }
    .section-title { font-size: 22px; }
    .values-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .value-icon { font-size: 44px; }
}

@media (max-width: 640px) {
    .home-hero { min-height: 380px; }
    .hero-title { font-size: 24px; }
    .hero-subtitle { font-size: 13px; max-width: 90%; }
    .search-form-hero { border-radius: 30px; }
    .search-input-hero { padding: 12px 16px; font-size: 14px; }
    .search-btn-hero { padding: 12px 18px; font-size: 14px; }
    .hero-tag { font-size: 11px; padding: 3px 10px; }
    .slide-content h2 { font-size: 20px; }
    .slide-arrow { width: 36px; height: 36px; font-size: 24px; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .feature-card { padding: 20px 12px 16px; }
    .feature-icon-wrap { width: 44px; height: 44px; }
    .values-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .value-card { padding: 24px 14px; }
    .value-icon { font-size: 40px; }
    .feature-card h3 { font-size: 15px; }
    .values-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .value-card { padding: 24px 16px; }
    .value-title { font-size: 16px; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-thumb { width: 100px; min-height: 90px; }
    .article-title { font-size: 14px; }
    .stats-row { gap: 16px; }
    .stat-item { padding: 12px 18px; }
    .stat-num { font-size: 24px; }
    .section-title { font-size: 20px; }
    .section-header-flex { flex-direction: column; align-items: center; gap: 8px; }
    .families-scroll { gap: 10px; }
    .family-mini-card { flex: 0 0 130px; }
}
