/* ========== 全局 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #6b0f0f;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 背景 ========== */
.background-container {
    min-height: 100vh;
    background:
        linear-gradient(rgba(107, 15, 15, 0.75), rgba(107, 15, 15, 0.85)),
        url("./background.jpg") center / cover no-repeat;
}

/* ========== 头部 ========== */
.header {
    width: 100%;
    background: rgba(107, 15, 15, 0.95);
    border-bottom: 4px solid #f8efa0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu ul {
    display: flex;
    gap: 8px;
    list-style: none;
}

.nav-menu a {
    color: #fff;
    font-size: 15px;
    padding: 8px 18px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(248, 239, 160, 0.18);
    color: #f8efa0;
}

.logo h1 {
    color: #f8efa0;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
}

.user-actions {
    display: flex;
    gap: 12px;
}

.btn-language,
.btn-donation {
    background: rgba(248, 239, 160, 0.1);
    border: 1px solid #f8efa0;
    color: #f8efa0;
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}

/* ========== 主视纪念 ========== */
.main-memorial {
    margin: 40px auto 0;
    max-width: 1200px;
    background:
        
        url("./memorial-bg.jpg") center / cover no-repeat;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    padding: 50px 20px;
}

.memorial-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 50px;
}

.photo-frame {
    width: 250px;
    height: 300px;
    border: 4px solid #f8efa0;
    border-radius: 10px;
    overflow: hidden;margin-left:30px;
    background: #fff;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.memorial-slogan {
    color: #f8efa0;
    text-align: center;
    margin-top: 15px;
    font-size: 16px;
}

.text-section h2 {
    color: #f8efa0;
    font-size: 26px;
    margin-bottom: 18px;
}

.text-content {
    color: #fff;
    font-size: 15px;
    line-height: 2;
    background: rgba(0, 0, 0, 0.3);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #f8efa0;
}

/* ========== 功能模块 ========== */
.features-section {
    margin: 40px auto 0;
    max-width: 1280px;
    padding: 0 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

/* ========== 通用卡片 ========== */
.feature-card {
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(rgba(107, 15, 15, 0.7), rgba(130, 20, 20, 0.8)),
        url("./card-bg.jpg") center / cover no-repeat;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 2px solid #f8efa0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.feature-card h3 {
    color: #f8efa0;
    font-size: 22px;
    text-align: center;
    border-bottom: 2px solid #f8efa0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* ========== 信息发布 ========== */
.info-release {
    min-height: 100%;
}

.news-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.news-item {
    display: flex;
    align-items: center;
    padding: 11px 6px;
    border-bottom: 1px solid rgba(248, 239, 160, 0.25);
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.news-item:hover {
    background-color: rgba(248, 239, 160, 0.1);
    padding-left: 14px;
}

.news-number {
    color: #f8efa0;
    font-weight: bold;
    margin-right: 12px;
    min-width: 18px;
}

.news-title {
    flex: 1;
    color: #fff;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
}

.news-date {
    color: #ccc;
    font-size: 12px;
    margin-left: 8px;
}

/* ========== 图片相册 ========== */
.photo-album {
    min-height: 100%;
}

.photo-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-content: start;
}

.photo-item {
    width: 100%;
}

.photo-item img {
    width: 100%;
    height: 100%;
    min-height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #f8efa0;
    transition: transform 0.3s ease;
}

.photo-item img:hover {
    transform: scale(1.08);
}

/* ========== 祭奠功能 ========== */
.memorial-function {
    min-height: 100%;
}

.candle-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    padding-bottom: 120px;
}

.candles {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    height: 220px;
    width: 100%;
}

/* 蜡烛主体 */
.candle {
    position: relative;
    width: 55px;
    height: 110px;
    background: linear-gradient(90deg, #c9a03f 0%, #fdd86e 40%, #df6d25 100%);
    border-radius: 8px / 30px;
    box-shadow: inset 0 -20px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: box-shadow 0.3s;
}

.candle.center {
    width: 110px;
    height: 160px;
}

/* 烛芯 */
.candle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 12px;
    background: #333;
    border-radius: 50% 50% 0 0;
    z-index: 2;
}

/* 烛火（默认熄灭） */
.flame {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 28px;
    background: radial-gradient(circle, #ff6a00 0%, #ff2200 70%, transparent 100%);
    border-radius: 50% 50% 30% 30% / 60% 60% 40% 40%;
    opacity: 0;
    transition: opacity 0.15s;
    filter: drop-shadow(0 0 8px rgba(255, 100, 0, 0.9));
    pointer-events: none;
    z-index: 3;
}

/* 点亮火苗 */
.candle.lit .flame {
    opacity: 1;
    animation: flicker 0.8s ease-in-out infinite alternate;
}

/* 点亮外发光 */
.candle.lit {
    box-shadow:
        inset 0 -20px 30px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(255, 150, 0, 0.4),
        0 0 60px rgba(255, 100, 0, 0.25);
}

@keyframes flicker {
    0%   { transform: translateX(-50%) scale(1)   rotate(-2deg); }
    50%  { transform: translateX(-50%) scale(1.1) rotate(2deg); }
    100% { transform: translateX(-50%) scale(0.95) rotate(-1deg); }
}

/* ========== 底部操作栏 ========== */
.memorial-actions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    padding: 14px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 10;
    width: 100%;
    max-width: 100%;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #fff;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 12px;
    transition: background 0.3s;
    user-select: none;
    flex: 1;
    min-width: 0;
}

.action-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.action-icon {
    font-size: 24px;
}

.action-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}

.action-label {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
}

.action-value {
    font-size: 18px;
    font-weight: bold;
    font-family: Arial, sans-serif;
}

.action-btn {
    background: linear-gradient(145deg, #ff9800, #f57c00);
    color: #fff;
    border: none;
    padding: 5px 18px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
    white-space: nowrap;
}

.action-btn:hover {
    transform: translateY(-1px);
}

/* 留言框 */
.message-box {
    margin-top: 15px;
    flex-shrink: 0;
}

.message-box textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: inherit;
    resize: none;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.9);
}

.submit-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #6b0f0f;
    color: #f8efa0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
}

/* ========== 页脚 ========== */
.footer {
    width: 100%;
    margin-top: 40px;
    background: rgba(107, 15, 15, 0.95);
    border-top: 4px solid #f8efa0;
    color: #f8efa0;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 20px;
    font-size: 14px;
}

/* ========== 响应式 ========== */

/* 平板 */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
.photo-section{margin-top:50px;}
    .memorial-content {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .candle {
        width: 40px;
        height: 80px;
    }

    .candle.center {
        width: 70px;
        height: 120px;
    }

    /* 手机端操作栏：3 个模块一排，严格居中 */
    .memorial-actions {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;

        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;

        width: 100%;
        max-width: 100%;
        margin-top: 15px;
        padding: 10px 6px;

        box-sizing: border-box;
    }

    .candle-area {
        padding-bottom: 0;
    }

    .action-item {
        flex: 1;
        min-width: 0;
        padding: 6px 4px;
    }

    .news-title {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-item img {
        min-height: 60px;
    }
}