/* ============================================
   重庆公墓网 cqgmw - 主样式
   主色 #1a7a6d 青绿 · 简约大气稳重典雅
   ============================================ */

/* —— CSS 变量 —— */
:root {
    --color-primary: #1a7a6d;
    --color-primary-dark: #0f5f54;
    --color-primary-deep: #093f38;
    --color-primary-light: #e8f3f1;
    --color-primary-soft: #f0f7f5;
    --color-bg: #f5f7f6;
    --color-bg-alt: #ffffff;
    --color-text: #2c3e3a;
    --color-text-light: #6b7c78;
    --color-text-muted: #9aaaa6;
    --color-border: #e3eae8;
    --color-border-light: #eef3f1;
    --color-gold: #b8985a;
    --color-gold-light: #f5efe0;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 3px rgba(15, 95, 84, 0.04);
    --shadow: 0 2px 12px rgba(15, 95, 84, 0.06);
    --shadow-lg: 0 8px 28px rgba(15, 95, 84, 0.1);
    --shadow-hover: 0 12px 36px rgba(26, 122, 109, 0.14);

    --container: 1200px;
    --header-h: 72px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
            "Noto Sans CJK SC", Helvetica, Arial, sans-serif;
    --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC",
                  "SimSun", "STSong", serif;
}

/* —— 重置 —— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--color-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* —— 容器 —— */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* —— 顶部导航 —— */
.topbar {
    background: var(--color-primary-deep);
    color: rgba(255,255,255,.85);
    font-size: 13px;
    line-height: 36px;
}
.topbar a { color: rgba(255,255,255,.85); }
.topbar a:hover { color: #fff; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.topbar-contact { display: flex; align-items: center; gap: 6px; }
.topbar-contact strong { color: #ffd966; font-size: 15px; letter-spacing: .5px; }
.topbar-links { display: flex; gap: 18px; }
.topbar-links span { opacity: .6; }

/* —— 主导航 —— */
.header {
    position: sticky; top: 0; z-index: 1000;
    background: #fff;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--color-border-light);
}
.header-inner {
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo img { height: 44px; }
.logo-text { line-height: 1.2; }
.logo-text .lt-main { font-size: 20px; font-weight: 700; color: var(--color-primary-dark); letter-spacing: 1px; }
.logo-text .lt-sub { font-size: 11px; color: var(--color-text-muted); letter-spacing: 2px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
    display: block; padding: 8px 16px;
    font-size: 15px; font-weight: 500; color: var(--color-text);
    border-radius: var(--radius); transition: all .2s;
}
.nav a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.nav a.is-active { background: var(--color-primary); color: #fff; }

.nav-toggle { display: none; padding: 8px; color: var(--color-text); }
.nav-toggle svg { width: 26px; height: 26px; }

/* —— 按钮 —— */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 22px; border-radius: var(--radius);
    font-size: 15px; font-weight: 500; line-height: 1;
    transition: all .2s; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline { background: #fff; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-ghost { background: rgba(26,122,109,.08); color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary); color: #fff; }
.btn-gold { background: var(--color-gold); color: #fff; }
.btn-gold:hover { background: #a3854a; color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

/* —— 通用区块 —— */
.section { padding: 56px 0; }
.section-sm { padding: 36px 0; }
.section-bg-white { background: #fff; }
.section-bg-light { background: var(--color-primary-soft); }
.section-bg-dark { background: var(--color-primary-deep); color: #fff; }

.section-head { text-align: center; margin-bottom: 40px; }
.section-head-left { text-align: left; }
.section-title { font-size: 28px; font-weight: 700; color: var(--color-primary-deep); letter-spacing: 1px; }
.section-title::after {
    content: ''; display: block; width: 48px; height: 3px;
    background: var(--color-primary); margin: 14px auto 0; border-radius: 2px;
}
.section-head-left .section-title::after { margin-left: 0; }
.section-desc { margin-top: 14px; color: var(--color-text-light); font-size: 15px; }

/* —— 面包屑 —— */
.breadcrumb {
    background: #fff; border-bottom: 1px solid var(--color-border-light);
    padding: 14px 0; font-size: 13px; color: var(--color-text-muted);
}
.breadcrumb a { color: var(--color-text-light); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .sep { margin: 0 8px; opacity: .5; }
.breadcrumb .current { color: var(--color-primary); }

/* —— 卡片网格 —— */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card {
    background: #fff; border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: transform .25s, box-shadow .25s, border-color .25s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--color-primary-light); }
.card-img { aspect-ratio: 16/10; overflow: hidden; position: relative; background: var(--color-primary-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 18px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--color-primary); }
.card-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--color-text-light); margin-bottom: 10px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-desc { font-size: 14px; color: var(--color-text-light); line-height: 1.7; flex: 1; }
.card-footer { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; }

/* —— 标签/徽章 —— */
.tag {
    display: inline-flex; align-items: center; padding: 2px 10px;
    font-size: 12px; line-height: 20px; border-radius: var(--radius-sm);
    background: var(--color-primary-light); color: var(--color-primary);
}
.tag-gold { background: var(--color-gold-light); color: var(--color-gold); }
.tag-gray { background: #f0f2f1; color: var(--color-text-light); }
.tag-outline { background: transparent; border: 1px solid var(--color-primary); }

/* —— Hero —— */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-deep) 0%, var(--color-primary-dark) 50%, var(--color-primary) 100%);
    color: #fff; padding: 80px 0 90px;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(184,152,90,.1) 0, transparent 40%);
    pointer-events: none;
}
.hero-inner { position: relative; max-width: 720px; }
.hero h1 { font-size: 38px; font-weight: 700; line-height: 1.3; margin-bottom: 18px; letter-spacing: 1px; }
.hero h1 em { font-style: normal; color: #ffd966; }
.hero p { font-size: 17px; color: rgba(255,255,255,.82); margin-bottom: 30px; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--color-primary-dark); }
.hero .btn-primary:hover { background: var(--color-gold); color: #fff; }
.hero .btn-outline { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn-outline:hover { background: rgba(255,255,255,.2); }

/* —— 区县导航 —— */
.district-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.district-grid a {
    display: block; padding: 12px 8px; text-align: center;
    background: #fff; border: 1px solid var(--color-border-light);
    border-radius: var(--radius); font-size: 14px; color: var(--color-text);
    transition: all .2s;
}
.district-grid a:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); transform: translateY(-2px); }

/* —— 服务入口 —— */
.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.entry-card {
    display: flex; align-items: center; gap: 20px;
    padding: 28px; border-radius: var(--radius-lg);
    background: #fff; border: 1px solid var(--color-border-light);
    transition: all .25s;
}
.entry-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.entry-icon {
    flex-shrink: 0; width: 64px; height: 64px;
    border-radius: var(--radius-lg); background: var(--color-primary-light);
    display: flex; align-items: center; justify-content: center;
}
.entry-icon svg { width: 32px; height: 32px; color: var(--color-primary); }
.entry-card:hover .entry-icon { background: var(--color-primary); }
.entry-card:hover .entry-icon svg { color: #fff; }
.entry-text h3 { font-size: 20px; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.entry-text p { font-size: 14px; color: var(--color-text-light); }
.entry-arrow { margin-left: auto; color: var(--color-text-muted); transition: all .2s; }
.entry-card:hover .entry-arrow { color: var(--color-primary); transform: translateX(4px); }
.entry-arrow svg { width: 22px; height: 22px; }

/* —— 筛选条 —— */
.filter-bar {
    background: #fff; border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 28px;
}
.filter-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.filter-row + .filter-row { border-top: 1px dashed var(--color-border-light); }
.filter-label { flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--color-text); min-width: 70px; }
.filter-items { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-items a {
    display: inline-block; padding: 4px 14px; font-size: 14px;
    color: var(--color-text-light); border-radius: 16px; transition: all .2s;
}
.filter-items a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.filter-items a.is-active { background: var(--color-primary); color: #fff; }

/* —— 详情页 —— */
.detail-head { margin-bottom: 24px; }
.detail-title { font-size: 26px; font-weight: 700; color: var(--color-text); margin-bottom: 14px; line-height: 1.4; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; color: var(--color-text-light); padding-bottom: 18px; border-bottom: 1px solid var(--color-border-light); }
.detail-meta span { display: inline-flex; align-items: center; gap: 4px; }

.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.detail-main { background: #fff; border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); padding: 32px; }
.detail-content { font-size: 16px; line-height: 1.9; color: var(--color-text); }
.detail-content p { margin-bottom: 16px; }
.detail-content h2, .detail-content h3 { margin: 28px 0 14px; color: var(--color-primary-deep); }
.detail-content img { border-radius: var(--radius); margin: 16px 0; }
.detail-content ul, .detail-content ol { padding-left: 22px; margin-bottom: 16px; list-style: disc; }
.detail-content ol { list-style: decimal; }
.detail-content li { margin-bottom: 6px; }
.detail-content blockquote { border-left: 4px solid var(--color-primary); padding: 12px 20px; background: var(--color-primary-soft); border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; color: var(--color-text-light); }

.detail-info { position: sticky; top: calc(var(--header-h) + 20px); }
.info-card { background: #fff; border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.info-card h3 { font-size: 16px; font-weight: 600; color: var(--color-primary-deep); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border-light); }
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-list li { display: flex; font-size: 14px; line-height: 1.6; }
.info-list li .il-label { flex-shrink: 0; color: var(--color-text-muted); min-width: 70px; }
.info-list li .il-value { color: var(--color-text); flex: 1; }

.info-contact { background: var(--color-primary); color: #fff; text-align: center; padding: 28px 24px; border-radius: var(--radius-lg); }
.info-contact .ic-title { font-size: 16px; margin-bottom: 6px; }
.info-contact .ic-phone { font-size: 26px; font-weight: 700; letter-spacing: 1px; margin-bottom: 14px; color: #ffd966; }
.info-contact .btn { background: #fff; color: var(--color-primary); }
.info-contact .btn:hover { background: var(--color-gold); color: #fff; }

/* —— 图集 —— */
.gallery-main { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 12px; }
.gallery-main img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gallery-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); cursor: pointer; border: 2px solid transparent; transition: border-color .2s; }
.gallery-thumbs img:hover, .gallery-thumbs img.is-active { border-color: var(--color-primary); }

/* —— 资讯列表 —— */
.news-list { display: flex; flex-direction: column; gap: 0; }
.news-item {
    display: flex; gap: 20px; padding: 22px 0;
    border-bottom: 1px solid var(--color-border-light);
}
.news-item:last-child { border-bottom: none; }
.news-item:hover .news-title { color: var(--color-primary); }
.news-date { flex-shrink: 0; width: 70px; text-align: center; background: var(--color-primary-soft); border-radius: var(--radius); padding: 12px 0; align-self: flex-start; }
.news-date .nd-day { font-size: 28px; font-weight: 700; color: var(--color-primary); line-height: 1; }
.news-date .nd-ym { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.news-body { flex: 1; }
.news-title { font-size: 17px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; transition: color .2s; }
.news-desc { font-size: 14px; color: var(--color-text-light); line-height: 1.7; }

/* —— 分页 —— */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    font-size: 14px; color: var(--color-text); transition: all .2s;
}
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination .disabled { color: var(--color-text-muted); cursor: not-allowed; }

/* —— 页脚 —— */
.footer { background: var(--color-primary-deep); color: rgba(255,255,255,.7); padding: 48px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand .logo { margin-bottom: 16px; }
.footer-brand .logo-text .lt-main { color: #fff; }
.footer-brand p { font-size: 14px; line-height: 1.8; opacity: .7; }
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 16px; font-weight: 600; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: rgba(255,255,255,.7); font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.footer-contact svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; margin-top: 2px; }
.footer-bottom { padding: 18px 0; text-align: center; font-size: 13px; opacity: .5; }
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: #fff; }
.footer-bottom .fb-sep { margin: 0 8px; }

/* —— 回到顶部 —— */
.back-top {
    position: fixed; right: 24px; bottom: 80px; z-index: 900;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--color-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg); cursor: pointer;
    opacity: 0; visibility: hidden; transition: all .3s;
}
.back-top.is-show { opacity: 1; visibility: visible; }
.back-top:hover { background: var(--color-primary-dark); transform: translateY(-3px); }
.back-top svg { width: 22px; height: 22px; }

/* —— 浮动咨询 —— */
.float-contact {
    position: fixed; right: 24px; bottom: 140px; z-index: 900;
    background: #fff; border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-lg);
    width: 200px; display: none;
}
.float-contact.is-show { display: block; }
.float-contact .fc-title { font-size: 14px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.float-contact .fc-phone { font-size: 20px; font-weight: 700; color: var(--color-primary); margin-bottom: 10px; }
.float-contact .btn { width: 100%; }

/* —— 页脚CTA按钮 —— */
.footer-cta {
    display: inline-block; margin-top: 14px; padding: 10px 24px;
    background: var(--color-primary); color: #fff !important;
    border-radius: var(--radius-md); font-size: 15px; font-weight: 600;
    text-decoration: none; transition: all .3s;
    box-shadow: 0 2px 12px rgba(26,122,109,.3);
}
.footer-cta:hover { background: var(--color-primary-dark); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(26,122,109,.4); }

/* —— 移动端浮动按钮 —— */
.mobile-fab {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 950;
    display: none; justify-content: space-around;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border-light);
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.fab-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 18px; font-size: 11px; color: var(--color-text-muted);
    text-decoration: none; cursor: pointer; transition: color .2s;
}
.fab-btn svg { width: 22px; height: 22px; }
.fab-btn:active { color: var(--color-primary); }
.fab-consult { color: var(--color-primary); }
.fab-consult svg { stroke: var(--color-primary); }

/* —— 空状态 —— */
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 16px; opacity: .4; }
.empty-state p { font-size: 15px; }

/* —— 响应式 —— */
@media (max-width: 1024px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid-4 { grid-template-columns: repeat(3, 1fr); }
    .district-grid { grid-template-columns: repeat(5, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-info { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .topbar-links { display: none; }

    .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
           flex-direction: column; background: #fff; padding: 12px 16px 20px; gap: 4px;
           box-shadow: var(--shadow-lg); border-top: 1px solid var(--color-border-light); }
    .nav.is-open { display: flex; }
    .nav a { width: 100%; padding: 12px 16px; }
    .nav-toggle { display: block; }

    .hero { padding: 50px 0 56px; }
    .hero h1 { font-size: 26px; }
    .hero p { font-size: 15px; }
    .hero-actions .btn { flex: 1; }

    .section { padding: 36px 0; }
    .section-title { font-size: 22px; }

    .card-grid, .card-grid-2, .card-grid-4 { grid-template-columns: 1fr; }
    .district-grid { grid-template-columns: repeat(3, 1fr); }
    .entry-grid { grid-template-columns: 1fr; }

    .detail-main { padding: 20px; }
    .detail-title { font-size: 20px; }
    .news-item { flex-direction: row; }

    .filter-bar { padding: 14px 16px; }
    .filter-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .filter-label { min-width: auto; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer { padding-top: 36px; }

    .float-contact, .back-top { right: 16px; }
    .back-top { bottom: 70px; }
    .mobile-fab { display: flex; }
    .footer-cta { display: inline-block; }
    body { padding-bottom: 56px; }
}
