/* ================================
   云祭扫 H5 - 公共样式
   国风浅色主题
   ================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #3c2f2f;
    background: linear-gradient(180deg, #84673a 0%, #4c3c1e 100%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.h5-page {
    min-height: 100vh;
}

.h5-wrap {
max-width: 750px;
margin: 0 auto;
padding-bottom: 80px;
position: relative;
/* center 垂直水平居中，保留no-repeat只显示一张原图 */
background: url(/assets/images/H5BG.png) center no-repeat, 
linear-gradient(180deg, #fdf5df 35%, #fef7e2 100%);
background-size: contain; /* 核心：完整显示整张原图，自动缩放适配容器 */
background-attachment: scroll; 
min-height: 100vh; /* 保证容器至少占满手机屏幕高度 */
background-attachment: fixed;/* 取消fixed，跟随页面滚动，移动端无bug */
}

/* 左侧阴影遮罩 */
.h5-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45px;
  pointer-events: none;
  z-index: 1;
}

.h5-wrap::before {
  left: 0;
  background: linear-gradient(to right, rgba(128, 113, 85, 0.12), transparent);
}

.h5-wrap::after {
  right: 0;
  background: linear-gradient(to left, rgba(128, 113, 85, 0.12), transparent);
}

/* ============ 顶部头部栏 ============ */
.h5-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: url(/assets/images/TINGB.svg) no-repeat top center,
                linear-gradient(180deg, #eae9d8 35%, #cfdac7 100%);
    background-size: 100% 100%;
    background-position: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 56px;
    height: auto;
    overflow: hidden;
}

.h5-header-title {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #6d4c41;
}

.h5-header-controls {
    display: flex;
    gap: 6px;
}

.ctrl-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #5e4138;
    font-size: 11px;
}

/* ============ 轮播 Banner ============ */
.banner-wrap {
    position: relative;
    margin: 8px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(139,69,19,0.12);
}

.banner-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 30/9;
    min-height: 140px;
}

.banner-item {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.6s;
}

.banner-item.active {
    opacity: 1;
}

.banner-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(139,69,19,0) 40%, rgba(139,69,19,0.5) 100%);
}

.banner-text {
    position: relative;
    text-align: center;
    z-index: 2;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.banner-text h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 6px;
    letter-spacing: 3px;
}

.banner-text p {
    font-size: 15px;
    opacity: 0.95;
}

.banner-btn {
    position: relative;
    z-index: 2;
    margin-top: 1px;
    padding: 3px 16px;
    background: linear-gradient(135deg, #fef7e2, #f0e8d2);
    color: #8c522d;
    border-radius: 16px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgb(148 134 131 / 34%);
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}

.banner-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.banner-dots span.active {
    width: 16px;
    border-radius: 3px;
    background: #fff;
}

/* ============ 站内通知 ============ */
.notice-bar {
    margin: 0 8px 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8B4513;
    border: 1px solid rgba(139,69,19,0.1);
}

.notice-icon {
    font-size: 15px;
}

.notice-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

/* ============ 图标宫格 ============ */
.icon-grid {
    margin: 0 8px 14px;
    padding: 16px 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 14px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 4px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(139,69,19,0.08);
}

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

.icon-box {
    width: 48px;
    height: 48px;
    margin: 0 auto 6px;
    background: linear-gradient(135deg, #5B8C5A 0%, #6FA06E 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(91,140,90,0.25);
    position: relative;
    overflow: hidden;
}

.icon-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent);
}

.icon-label {
    font-size: 11px;
    color: #5C4033;
    line-height: 1.3;
}

/* ============ 图文卡片 ============ */
.card-section {
    margin: 0 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
}

.card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 3px 12px rgba(139,69,19,0.15);
}

/* 创建云墓: 左侧，跨2行（大高卡） */
.card-tomb-large {
    grid-column: 1;
    grid-row: 1 / span 2;
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: flex-end;
}

/* 咨询反馈: 右上，1行（矮卡） */
.card-fb {
    grid-column: 2;
    grid-row: 1;
    aspect-ratio: 8/ 3;
    display: flex;
    align-items: flex-end;
}

/* 陵园导航: 左下，1行（矮卡） */
.card-nav {
    grid-column: 1;
    grid-row: 3;
    aspect-ratio: 8 / 3;
    display: flex;
    align-items: flex-end;
}

/* 云相册: 右侧，跨2行（大高卡） */
.card-album {
    grid-column: 2;
    grid-row: 2 / span 2;
    aspect-ratio: 3/ 2;
    display: flex;
    align-items: flex-end;
}

/* 数字服务大厅: 通栏 */
.card-hall-full {
    aspect-ratio: 10 / 2;
    display: flex;
    align-items: flex-end;
}

.card-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(116 109 104 / 60%), rgb(103 103 103 / 20%));
}

.card-content {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
    color: #fff;
}

/* 陵园导航的AR标签放底部 */
.card-nav .card-content {
    top: auto;
    bottom: 12px;
}

.card-content h3 {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.card-content h4 {
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.card-content p {
    font-size: 12px;
    opacity: 0.9;
}

.ar-tag {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #FF6B35, #FF8C42);
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 6px;
}

.hall-sub {
    opacity: 0.85;
}

/* ============ AI 模型区 ============ */
.ai-section {
    margin: 0 8px 14px;
    padding: 14px 0;
    background: rgba(255,255,255,0.7);
    border-radius: 14px;
    border: 1px solid rgba(139,69,19,0.08);
}

.section-title {
    padding: 0 14px 12px;
    font-size: 15px;
    font-weight: bold;
    color: #5C4033;
    border-bottom: 1px solid rgba(139,69,19,0.08);
    margin-bottom: 10px;
}

.ai-scroll {
    display: flex;
    gap: 10px;
    padding: 4px 12px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.ai-scroll::-webkit-scrollbar {
    display: none;
}

.ai-card {
    flex-shrink: 0;
    width: 100px;
    text-align: center;
    scroll-snap-align: start;
}

.ai-img {
    width: 80px;
    aspect-ratio: 1;
    margin: 0 auto 8px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(139,69,19,0.2);
}

.ai-info h4 {
    font-size: 13px;
    color: #5C4033;
    margin-bottom: 2px;
}

.ai-info p {
    font-size: 11px;
    color: #8B6F47;
}

/* ============ 心灵树洞 ============ */
.hole-banner {
    margin: 0 8px 14px;
    aspect-ratio: 10 / 2;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 14px rgba(91,58,32,0.2);
}

.hole-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(46,30,15,0.6), rgba(46,30,15,0.2));
}

.hole-banner-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 20px;
}

.hole-text {
    color: #F5DEB3;
}

.hole-text h3 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.hole-text p {
    font-size: 13px;
    line-height: 1.6;
    opacity: 0.95;
}

/* ============ 双栏卡片 ============ */
.dual-section {
    margin: 0 8px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dual-card {
    position: relative;
    aspect-ratio: 5 / 3;
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 3px 10px rgba(139,69,19,0.15);
}

.dual-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(60,30,15,0.5) 100%);
}

.dual-content {
    position: absolute;
    bottom: 12px;
    left: 14px;
    right: 14px;
    z-index: 2;
    color: #fff;
}

.dual-content h4 {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 3px;
}

.dual-content p {
    font-size: 11px;
    opacity: 0.9;
}

/* ============ 服务中心 ============ */
.service-section {
    margin: 0 8px 14px;
    padding: 14px;
    background: rgba(255,255,255,0.7);
    border-radius: 14px;
    border: 1px solid rgba(139,69,19,0.08);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.service-header h3 {
    font-size: 16px;
    font-weight: bold;
    color: #5C4033;
}

.fire {
    color: #FF6347;
}

.more-link {
    font-size: 13px;
    color: #8B4513;
}

.service-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.service-item {
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(139,69,19,0.08);
}

.service-img {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: #F5EDDE;
}

.service-info {
    padding: 8px;
}

.service-info h4 {
    font-size: 12px;
    font-weight: bold;
    color: #5C4033;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-desc {
    font-size: 10px;
    color: #8B6F47;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price {
    font-size: 13px;
    font-weight: bold;
    color: #C0392B;
}

/* ============ 底部标语 ============ */
.slogan-bar {
    margin: 0 8px 14px;
    padding: 80px 16px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    text-align: center;
}

.slogan-bar p {
    font-size: 12px;
    color: #6B5544;
    line-height: 1.8;
    letter-spacing: 1px;
    margin-top: -70px;
}

/* ============ 底部导航 ============ */
.bottom-nav {
position: fixed;
    bottom: 0;
    /* 左右不贴死屏幕，留出圆角显示空间 */
    left: 50%;
    transform: translateX(-50%);
    max-width: 750px;
    width: 100%;
    height: 60px;
    background: rgba(255,255,255,0.97);
    border-top: 1px solid rgba(139,69,19,0.1);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    z-index: 999;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
    padding: 16px 0;
    /* 统一简写圆角，px单位 */
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: #8B6F47;
    transition: color 0.2s;
}

.nav-item.active {
    color: #8B4513;
}

.nav-icon {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.nav-home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B6F47' stroke-width='2'%3E%3Cpath d='M3 12l9-9 9 9M5 10v10h14V10'/%3E%3C/svg%3E");
}

.nav-item.active .nav-home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B4513' stroke-width='2.5'%3E%3Cpath d='M3 12l9-9 9 9M5 10v10h14V10'/%3E%3C/svg%3E");
}

.nav-tomb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B6F47' stroke-width='2'%3E%3Crect x='4' y='8' width='16' height='14' rx='2'/%3E%3Cpath d='M9 8V5a3 3 0 0 1 6 0v3'/%3E%3C/svg%3E");
}

.nav-item.active .nav-tomb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B4513' stroke-width='2.5'%3E%3Crect x='4' y='8' width='16' height='14' rx='2'/%3E%3Cpath d='M9 8V5a3 3 0 0 1 6 0v3'/%3E%3C/svg%3E");
}

.nav-user {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B6F47' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 22c0-4 4-7 8-7s8 3 8 7'/%3E%3C/svg%3E");
}

.nav-item.active .nav-user {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B4513' stroke-width='2.5'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 22c0-4 4-7 8-7s8 3 8 7'/%3E%3C/svg%3E");
}

/* ============ 工具类 ============ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }

/* ============ 响应式 ============ */
@media (min-width: 420px) {
    .banner-text h2 { font-size: 28px; }
}

/* ============ 动画 ============ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-grid-layout .card, .dual-card, .ai-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.card-grid-layout .card:nth-child(1) { animation-delay: 0.05s; }
.card-grid-layout .card:nth-child(2) { animation-delay: 0.1s; }
.card-grid-layout .card:nth-child(3) { animation-delay: 0.15s; }
.card-grid-layout .card:nth-child(4) { animation-delay: 0.2s; }
.card-grid-layout .card:nth-child(5) { animation-delay: 0.25s; }
