/* ===== 语言切换逻辑 ===== */
body:not(.lang-en-active) .lang-en {
    display: none !important;
}

body.lang-en-active .lang-zh {
    display: none !important;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-toggle {
    background: transparent;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.lang-toggle:hover {
    background: var(--color-gold);
    color: var(--bg-dark);
}

/* 英文排版优化 */
body.lang-en-active {
    line-height: 1.6;
}

.lang-en {
    letter-spacing: 0.02em !important; /* 英文不需要过大的字间距 */
    text-align: left !important; /* 强制英文左对齐 */
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* 确保英文容器内的所有段落和标题都遵循左对齐 */
.lang-en p, 
.lang-en h1, 
.lang-en h2, 
.lang-en h3, 
.lang-en h4,
.lang-en .card-content,
.lang-en .scroll-body {
    text-align: left !important;
}

.scroll-body .lang-en p {
    text-indent: 0; /* 英文通常不首行缩进 */
    margin-bottom: 1.2em;
}

.timeline-content .lang-en p {
    line-height: 1.5;
    font-size: 13px;
}

.card-content-wrapper .lang-en .card-content {
    line-height: 1.6;
    font-size: 15px;
}

.heritage-desc.lang-en {
    line-height: 1.7;
    font-size: 16px;
    max-width: 90%;
    margin: 0 auto;
}

/* 针对英文标题的微调 */
.lang-en h4, .lang-en h3 {
    letter-spacing: 0.05em !important;
    line-height: 1.3;
}

/* ===== 基础变量定义 ===== */
:root {
    /* 主色调 - 中国传统色 */
    --color-primary: #8B2323;      /* 朱红/枣红 */
    --color-primary-dark: #5C1616; /* 深朱红 */
    --color-gold: #C9A86C;         /* 古铜金 */
    --color-gold-light: #D4B87A;   /* 浅金 */
    --color-ink: #2C2416;          /* 墨色 */
    --color-ink-light: #4A3F2F;    /* 浅墨 */
    
    /* 背景色 */
    --bg-cream: #F5F0E6;           /* 米色/宣纸色 */
    --bg-cream-dark: #E8E0D0;      /* 深米色 */
    --bg-wood: #3D2B1F;            /* 木色 */
    --bg-dark: #1A1410;            /* 深棕黑 */
    
    /* 文字色 */
    --text-dark: #2C2416;
    --text-light: #F5F0E6;
    --text-muted: #6B5D4D;
    
    /* 字体 */
    --font-display: 'Ma Shan Zheng', cursive;    /* 书法字体 */
    --font-body: 'Noto Serif SC', serif;         /* 正文宋体 */
    
    /* 间距 */
    --section-padding: 100px;
    --container-width: 1200px;
}

/* ===== 重置样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
    /* 适配 iOS 安全区域 */
    padding-bottom: env(safe-area-inset-bottom);
}

/* 针对大屏旗舰手机（如 iPhone 17 Pro Max）的优化 */
@media (max-width: 480px) {
    :root {
        --section-padding: 60px;
    }
    
    .nav-bar {
        /* 避开灵动岛/刘海 */
        padding-top: env(safe-area-inset-top);
        height: auto;
        min-height: 70px;
    }

    .hero {
        /* 使用动态视口单位防止超长屏留白 */
        height: 100svh; 
    }

    .timeline-img {
        height: 220px; /* 大屏手机可以显示更高的图片 */
    }

    .container {
        padding: 0 25px; /* 增加侧边距，更符合大屏手感 */
    }
}

/* ===== 通用样式 ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== 导航栏 ===== */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(26, 20, 16, 0.95) 0%, rgba(26, 20, 16, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-gold);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--color-gold);
    letter-spacing: 4px;
}

.logo-sub {
    font-size: 11px;
    color: var(--color-gold-light);
    letter-spacing: 2px;
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 2px;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transition: width 0.3s ease;
}

.nav-menu a:hover {
    color: var(--color-gold);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 移动端汉堡菜单按钮 */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--color-gold);
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-gold);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-gold);
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    top: 6px;
}

/* 菜单展开时的X形状 */
.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ===== 主视觉区域 ===== */
.hero {
    height: 100vh;
    min-height: 700px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        url('../assets/images/entrance-main.jpg') center/cover no-repeat;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at center, transparent 0%, rgba(26, 20, 16, 0.6) 70%),
        linear-gradient(180deg, rgba(26, 20, 16, 0.3) 0%, rgba(26, 20, 16, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.hero-badge {
    display: inline-block;
    padding: 10px 40px;
    border: none; /* 去除边框 */
    color: var(--color-gold);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 8px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.4);
    /* 已去除 text-shadow 和 box-shadow */
}

.hero-logo-img {
    max-width: 480px; /* 缩小 20% (原 600px * 0.8) */
    margin: 0 auto 30px;
    animation: fadeInUp 1s ease-out;
}

.hero-logo-img img {
    width: 100%;
    height: auto;
    /* 增加金色的外发光滤镜，让 Logo 更加醒目 */
    filter: drop-shadow(0 0 15px rgba(201, 168, 108, 0.8)) 
            drop-shadow(0 0 30px rgba(201, 168, 108, 0.4));
    transition: filter 0.3s ease;
}

.hero-logo-img img:hover {
    /* 悬停时发光更强 */
    filter: drop-shadow(0 0 20px rgba(201, 168, 108, 1)) 
            drop-shadow(0 0 40px rgba(201, 168, 108, 0.6));
}

@media (max-width: 768px) {
    .hero-logo-img {
        max-width: 64%; /* 手机端缩小 20% (原 80% * 0.8) */
    }
}

.hero-subtitle {
    font-size: clamp(18px, 3vw, 24px);
    letter-spacing: 8px;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-divider {
    margin: 30px auto;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.divider-ornament {
    color: var(--color-gold);
    font-size: 24px;
}

.hero-desc {
    font-size: 16px;
    letter-spacing: 3px;
    opacity: 0.8;
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

/* 向下滑动提示 */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.scroll-text {
    font-size: 12px;
    color: var(--color-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scroll-arrow span {
    display: block;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--color-gold);
    border-right: 2px solid var(--color-gold);
    transform: rotate(45deg);
    margin: -4px;
    animation: scroll-arrow-anim 2s infinite;
}

.scroll-arrow span:nth-child(2) {
    animation-delay: -0.2s;
}

.scroll-arrow span:nth-child(3) {
    animation-delay: -0.4s;
}

@keyframes scroll-arrow-anim {
    0% {
        opacity: 0;
        transform: rotate(45deg) translate(-10px, -10px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(45deg) translate(10px, 10px);
    }
}

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

/* 背景音乐播放器 */
.audio-player {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 10;
}

.audio-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(201, 168, 108, 0.2);
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.audio-btn:hover {
    background: rgba(201, 168, 108, 0.3);
}

.audio-btn.playing .audio-icon {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== 板块通用样式 ===== */
.section {
    padding: var(--section-padding) 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header.light {
    color: var(--text-light);
}

.section-header.light .section-number {
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.section-header.light .section-line {
    background: var(--color-gold);
}

.section-number {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--color-primary);
    margin-bottom: 20px;
    display: inline-block;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    letter-spacing: 10px;
    margin-bottom: 20px;
}

.section-line {
    width: 60px;
    height: 3px;
    background: var(--color-primary);
    margin: 0 auto;
}

/* ===== 第一板块：大门整体介绍 ===== */
.section-entrance {
    background: var(--bg-cream);
}

.entrance-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: start;
}

.entrance-gallery {
    position: relative;
}

.main-image-frame {
    position: relative;
    padding: 20px;
    background: var(--bg-wood);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.frame-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--color-gold);
}

.frame-corner.top-left {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.frame-corner.top-right {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.frame-corner.bottom-left {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
}

.frame-corner.bottom-right {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.main-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--bg-cream-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-caption {
    text-align: center;
    padding: 15px;
    color: var(--color-gold);
    font-size: 14px;
    letter-spacing: 3px;
}

.thumbnail-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.thumbnail-item {
    text-align: center;
}

.thumbnail {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 3px solid var(--bg-wood);
    transition: transform 0.3s ease;
    cursor: pointer;
    background: var(--bg-cream-dark);
}

.thumbnail:hover {
    transform: scale(1.05);
}

.thumb-label {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* 文字卡片 */
.text-card {
    background: #fff;
    padding: 40px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--color-primary);
}

.card-seal {
    position: absolute;
    top: -20px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    color: var(--color-gold);
    font-family: var(--font-display);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(139, 35, 35, 0.4);
}

.card-title {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--color-primary);
    margin-bottom: 15px;
    letter-spacing: 4px;
}

.card-divider {
    width: 40px;
    height: 2px;
    background: var(--color-gold);
    margin-bottom: 20px;
}

.card-content {
    font-size: 16px;
    line-height: 2;
    color: var(--text-dark);
    text-align: justify;
}

/* 音频卡片 */
.audio-card {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-cream);
    border: 1px solid var(--bg-cream-dark);
}

.audio-card.dark {
    background: var(--bg-wood);
    border-color: var(--color-gold);
}

.audio-card.light {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-gold);
}

.audio-card.center {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 50px;
}

.audio-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.audio-card.dark .audio-title,
.audio-card.light .audio-title {
    color: var(--color-gold);
}

.audio-icon-small {
    font-size: 16px;
}

.custom-audio {
    width: 100%;
    height: 40px;
}

/* ===== 第二板块：堂志介绍 ===== */
.section-history {
    background: 
        url('../assets/images/pattern-light.png') repeat,
        linear-gradient(180deg, var(--bg-cream-dark) 0%, var(--bg-cream) 100%);
}

.history-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* 卷轴样式 */
.scroll-frame {
    background: #FDF8F0;
    position: relative;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.scroll-top,
.scroll-bottom {
    height: 40px;
    background: 
        linear-gradient(90deg, var(--bg-wood) 0%, #5C4030 50%, var(--bg-wood) 100%);
    position: relative;
}

.scroll-top::after,
.scroll-bottom::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 4px;
    background: var(--color-gold);
    top: 50%;
    margin-top: -2px;
}

.scroll-content {
    padding: 40px 50px;
    background: 
        linear-gradient(90deg, rgba(0,0,0,0.03) 0%, transparent 5%, transparent 95%, rgba(0,0,0,0.03) 100%),
        #FDF8F0;
    border-left: 3px solid var(--bg-cream-dark);
    border-right: 3px solid var(--bg-cream-dark);
}

.scroll-title {
    font-family: var(--font-display);
    font-size: 36px;
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 30px;
    letter-spacing: 8px;
}

.scroll-body {
    font-size: 16px;
    line-height: 2.2;
    text-align: justify;
}

.scroll-body p {
    margin-bottom: 20px;
    text-indent: 2em;
}

/* 图片网格 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-item.large {
    grid-column: span 2;
    aspect-ratio: 2/1;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    background: var(--bg-cream-dark);
}

.gallery-item:hover .gallery-img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 20, 16, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    color: var(--color-gold);
    font-size: 18px;
    letter-spacing: 4px;
    border: 1px solid var(--color-gold);
    padding: 10px 25px;
}

/* ===== 第三板块：企业大事记 ===== */
.section-events {
    background: var(--bg-cream);
    padding-bottom: 120px;
}

/* 视频展示 */
.video-showcase {
    max-width: 900px;
    margin: 0 auto 80px;
}

.video-frame {
    position: relative;
    background: var(--bg-wood);
    padding: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.video-frame::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid var(--color-gold);
    pointer-events: none;
}

.video-frame video {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    display: block;
}

.video-frame.large {
    padding: 20px;
}

.video-caption {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 3px;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--color-gold) 0%, var(--color-primary) 100%);
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-year {
    flex: 0 0 100px;
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--color-primary);
    text-align: center;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--color-gold);
    border: 4px solid var(--bg-cream);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--color-primary);
    z-index: 1;
}

.timeline-content {
    flex: 1;
    background: #fff;
    padding: 0; /* 移除内边距，让图片能撑满顶部 */
    margin: 0 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden; /* 确保图片放大时不超出边界 */
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-img {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--bg-cream-dark);
}

.timeline-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.timeline-content:hover .timeline-img img {
    transform: scale(1.1);
}

.timeline-text {
    padding: 20px 25px;
}

.timeline-content h4 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--color-primary);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.timeline-content p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== 第四板块：膏方非遗技艺 ===== */
.section-heritage {
    background: 
        linear-gradient(180deg, var(--bg-dark) 0%, var(--color-primary-dark) 100%);
    color: var(--text-light);
    padding-bottom: 120px;
}

.heritage-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.heritage-badge {
    display: inline-block;
    padding: 12px 40px;
    border: 2px solid var(--color-gold);
    margin-bottom: 30px;
    position: relative;
}

.heritage-badge::before,
.heritage-badge::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gold);
}

.heritage-badge::before {
    left: -20px;
}

.heritage-badge::after {
    right: -20px;
}

.badge-text {
    font-size: 18px;
    letter-spacing: 6px;
    color: var(--color-gold);
}

.heritage-desc {
    font-size: 17px;
    line-height: 2;
    opacity: 0.9;
}

/* 工艺流程 */
.craft-process {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 80px;
}

.process-item {
    text-align: center;
    width: 180px;
}

.process-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-gold);
    background: var(--bg-wood);
}

.process-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.process-info h4 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--color-gold);
    margin-bottom: 5px;
}

.process-info p {
    font-size: 13px;
    opacity: 0.7;
}

.process-arrow {
    font-size: 30px;
    color: var(--color-gold);
    opacity: 0.5;
}

/* 非遗图片展示 */
.heritage-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 60px;
}

.heritage-img-item {
    position: relative;
    overflow: hidden;
}

.heritage-img-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.5s ease;
    background: var(--bg-wood);
}

.heritage-img-item:hover img {
    transform: scale(1.08);
}

.img-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--color-gold);
    font-size: 15px;
    letter-spacing: 3px;
    text-align: center;
}

/* 非遗视频 */
.heritage-video {
    max-width: 1000px;
    margin: 0 auto;
}

/* ===== 页脚 ===== */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.footer-pattern {
    position: absolute;
    inset: 0;
    background: url('../assets/images/pattern-dark.png') repeat;
    opacity: 0.1;
}

.footer-content {
    position: relative;
    text-align: center;
    padding: 60px 20px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--color-gold);
    letter-spacing: 8px;
    display: block;
}

.footer-subtitle {
    font-size: 13px;
    color: var(--color-gold-light);
    opacity: 0.7;
    letter-spacing: 4px;
}

.footer-info p {
    font-size: 16px;
    letter-spacing: 6px;
    opacity: 0.8;
    margin-bottom: 30px;
}

.footer-divider {
    width: 100px;
    height: 1px;
    background: var(--color-gold);
    margin: 0 auto 30px;
    opacity: 0.5;
}

.footer-copyright {
    font-size: 13px;
    opacity: 0.5;
}

/* ===== 回到顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
}

/* ===== 响应式设计 - 移动端优先 ===== */

/* 平板端 */
@media (max-width: 1024px) {
    .entrance-content,
    .history-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(odd) {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 60px;
    }
    
    .timeline-dot {
        left: 20px;
        transform: none;
    }
    
    .timeline-year {
        text-align: left;
        margin-bottom: 10px;
    }
    
    .timeline-content {
        margin: 0;
    }
    
    .timeline-item .timeline-content::after,
    .timeline-item:nth-child(odd) .timeline-content::after {
        display: none;
    }
}

/* 移动端 */
@media (max-width: 768px) {
    :root {
        --section-padding: 50px;
    }
    
    /* 导航栏移动端样式 */
    .nav-container {
        height: 60px;
    }
    
    .logo-text {
        font-size: 22px;
        letter-spacing: 2px;
    }
    
    .logo-sub {
        font-size: 10px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(26, 20, 16, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(201, 168, 108, 0.2);
    }
    
    .nav-menu a {
        display: block;
        padding: 20px;
        font-size: 18px;
        letter-spacing: 4px;
    }
    
    .nav-menu a::after {
        display: none;
    }
    
    /* Hero区域移动端 */
    .hero {
        min-height: 100vh;
        min-height: 100svh; /* 移动端安全视口高度 */
    }
    
    .hero-badge {
        padding: 6px 20px;
        font-size: 12px;
        letter-spacing: 4px;
        margin-bottom: 20px;
    }
    
    .hero-title {
        font-size: 48px;
        letter-spacing: 8px;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 14px;
        letter-spacing: 4px;
        margin-bottom: 20px;
    }
    
    .hero-divider {
        margin: 20px auto;
    }
    
    .hero-desc {
        font-size: 13px;
        letter-spacing: 1px;
        padding: 0 20px;
    }
    
    /* 板块标题移动端 */
    .section-number {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .section-title {
        font-size: 24px;
        letter-spacing: 6px;
        margin-bottom: 15px;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    /* 大门板块移动端 */
    .main-image-frame {
        padding: 12px;
    }
    
    .frame-corner {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }
    
    .image-caption {
        padding: 10px;
        font-size: 12px;
    }
    
    .thumbnail-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 15px;
    }
    
    .thumb-label {
        font-size: 11px;
        margin-top: 5px;
    }
    
    .text-card {
        padding: 25px 18px;
        margin-top: 0;
    }
    
    .card-seal {
        width: 45px;
        height: 45px;
        font-size: 24px;
        top: -15px;
        right: 20px;
    }
    
    .card-title {
        font-size: 20px;
        letter-spacing: 2px;
        margin-bottom: 12px;
    }
    
    .card-content {
        font-size: 14px;
        line-height: 1.9;
    }
    
    /* 堂志板块移动端 */
    .scroll-top,
    .scroll-bottom {
        height: 30px;
    }
    
    .scroll-content {
        padding: 25px 20px;
    }
    
    .scroll-title {
        font-size: 26px;
        letter-spacing: 4px;
        margin-bottom: 20px;
    }
    
    .scroll-body {
        font-size: 14px;
        line-height: 2;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .gallery-item.large {
        grid-column: span 1;
        aspect-ratio: 16/9;
    }
    
    .gallery-overlay span {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    /* 时间轴移动端 */
    .video-showcase {
        margin-bottom: 50px;
    }
    
    .video-frame {
        padding: 10px;
    }
    
    .video-caption {
        padding: 12px;
        font-size: 12px;
    }
    
    .timeline {
        padding: 30px 0;
    }
    
    .timeline-year {
        font-size: 22px;
        flex: 0 0 auto;
    }
    
    .timeline-content {
        padding: 18px 15px;
    }
    
    .timeline-content h4 {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .timeline-content p {
        font-size: 13px;
    }
    
    /* 膏方非遗移动端 */
    .heritage-badge {
        padding: 10px 25px;
        margin-bottom: 20px;
    }
    
    .heritage-badge::before,
    .heritage-badge::after {
        display: none;
    }
    
    .badge-text {
        font-size: 14px;
        letter-spacing: 3px;
    }
    
    .heritage-desc {
        font-size: 14px;
        line-height: 1.9;
        padding: 0 10px;
    }
    
    .heritage-intro {
        margin-bottom: 40px;
    }
    
    .craft-process {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 50px;
    }
    
    .process-item {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 20px;
        text-align: left;
    }
    
    .process-icon {
        width: 80px;
        height: 80px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .process-info h4 {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    .process-info p {
        font-size: 12px;
    }
    
    .process-arrow {
        display: none;
    }
    
    .heritage-video {
        margin-bottom: 30px;
    }
    
    .video-frame.large {
        padding: 12px;
    }
    
    .heritage-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 40px;
    }
    
    .img-caption {
        font-size: 13px;
        padding: 12px;
    }
    
    /* 音频卡片移动端 */
    .audio-card {
        padding: 15px;
        margin-top: 20px;
    }
    
    .audio-card.center {
        margin-top: 30px;
    }
    
    .audio-title {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    /* 页脚移动端 */
    .footer-content {
        padding: 40px 20px;
    }
    
    .footer-title {
        font-size: 28px;
        letter-spacing: 5px;
    }
    
    .footer-subtitle {
        font-size: 11px;
    }
    
    .footer-info p {
        font-size: 14px;
        letter-spacing: 3px;
        margin-bottom: 20px;
    }
    
    /* 按钮移动端 */
    .audio-player {
        bottom: 15px;
        right: 15px;
    }
    
    .audio-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}

/* 小屏手机 */
@media (max-width: 375px) {
    .hero-title {
        font-size: 40px;
        letter-spacing: 6px;
    }
    
    .hero-subtitle {
        font-size: 12px;
        letter-spacing: 2px;
    }
    
    .section-title {
        font-size: 20px;
        letter-spacing: 4px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .scroll-title {
        font-size: 22px;
    }
    
    .timeline-year {
        font-size: 18px;
    }
    
    .timeline-content h4 {
        font-size: 16px;
    }
    
    .process-icon {
        width: 65px;
        height: 65px;
    }
}

/* ===== 图片占位样式（用户提供图片前） ===== */
img[src$=".jpg"],
img[src$=".png"] {
    display: block;
    max-width: 100%;
    height: auto;
}

img[src$=".jpg"]::before,
img[src$=".png"]::before {
    content: '图片待添加';
    position: absolute;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== 语言切换逻辑 ===== */
body:not(.lang-en-active) .lang-en {
    display: none !important;
}

body.lang-en-active .lang-zh {
    display: none !important;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 15px;
}

.lang-toggle {
    background: transparent;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.lang-toggle:hover {
    background: var(--color-gold);
    color: var(--bg-dark);
}

/* 英文排版优化 */
body.lang-en-active {
    line-height: 1.6;
}

.lang-en {
    letter-spacing: 0.02em !important; /* 英文不需要过大的字间距 */
    text-align: left !important; /* 强制英文左对齐 */
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* 确保英文容器内的所有段落和标题都遵循左对齐 */
.lang-en p, 
.lang-en h1, 
.lang-en h2, 
.lang-en h3, 
.lang-en h4,
.lang-en .card-content,
.lang-en .scroll-body {
    text-align: left !important;
}

.scroll-body .lang-en p {
    text-indent: 0; /* 英文通常不首行缩进 */
    margin-bottom: 1.2em;
}

.timeline-content .lang-en p {
    line-height: 1.5;
    font-size: 13px;
}

.card-content-wrapper .lang-en .card-content {
    line-height: 1.6;
    font-size: 15px;
}

.heritage-desc.lang-en {
    line-height: 1.7;
    font-size: 16px;
    max-width: 90%;
    margin: 0 auto;
}

/* 针对英文标题的微调 */
.lang-en h4, .lang-en h3 {
    letter-spacing: 0.05em !important;
    line-height: 1.3;
}
