* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    min-height: 100vh;
}

.memorial-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 花圈和头像部分 */
.wreath-section {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wreath {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

.portrait {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ddd;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    z-index: 1;
    margin-left: 10px;
    background-color: #fff;
}

/* 标题 */
.title {
    text-align: center;
    font-size: 36px;
    margin: 30px 0;
    font-weight: 300;
    letter-spacing: 3px;
}

/* 献花功能 */
.flower-tribute {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.tribute-btn {
    background-color: #8B0000;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.tribute-btn:hover {
    background-color: #a00000;
    transform: scale(1.05);
}

.tribute-btn:active {
    transform: scale(0.98);
}

.tribute-count {
    font-size: 16px;
    text-align: center;
}

.count-number {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b6b;
    margin: 0 8px;
}

/* 字体大小控制 */
.font-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px 0;
    position: relative;
    z-index: 10;
}

.font-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #555;
    background: #1a1a1a;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.font-btn:hover {
    background: #333;
    color: #fff;
    border-color: #888;
}

.font-btn:active {
    background: #444;
    transform: scale(0.95);
}

/* 分栏目 */
.tabs-container {
    margin-top: 50px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #333;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #999;
    padding: 15px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 1px;
}

.tab-btn:hover {
    color: #ddd;
}

.tab-btn.active {
    color: #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 生平简介 */
.content-text {
    line-height: 1.8;
    color: #ccc;
}

.content-text p {
    margin-bottom: 15px;
    text-align: justify;
}

/* 生前照片 */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.photo-item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid #333;
    border-radius: 5px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.photo-item:hover {
    transform: scale(1.05);
}

/* 图片放大弹窗样式 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.modal-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    animation: zoomIn 0.3s ease-in-out;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.2);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 平板端适配 */
@media (max-width: 768px) {
    .memorial-container {
        padding: 30px 15px;
    }

    .wreath-section {
        width: 400px;
        height: 400px;
        margin: 30px auto;
    }

    .portrait {
        width: 140px;
        height: 140px;
    }

    .title {
        font-size: 28px;
        margin: 20px 0;
    }

    .tab-btn {
        font-size: 14px;
        padding: 12px 15px;
    }

    .tribute-btn {
        padding: 10px 25px;
        font-size: 14px;
    }

    .count-number {
        font-size: 20px;
    }

    .font-control {
        gap: 15px;
        padding: 15px 0;
    }

    .font-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
        border: 2px solid #555;
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .modal-close {
        top: 20px;
        right: 25px;
        font-size: 35px;
    }
}

/* 手机端适配 */
@media (max-width: 480px) {
    .memorial-container {
        padding: 20px 10px;
    }

    .wreath-section {
        width: 280px;
        height: 280px;
        margin: 20px auto;
    }

    .portrait {
        width: 130px;
        height: 130px;
        border: 2px solid #ddd;
    }

    .title {
        font-size: 24px;
        margin: 15px 0;
        letter-spacing: 2px;
    }

    .flower-tribute {
        margin: 25px 0;
        gap: 15px;
    }

    .tribute-btn {
        padding: 10px 20px;
        font-size: 14px;
        letter-spacing: 1px;
    }

    .tribute-count {
        font-size: 14px;
    }

    .count-number {
        font-size: 18px;
    }

    .tabs-container {
        margin-top: 30px;
    }

    .tab-btn {
        font-size: 13px;
        padding: 10px 10px;
        letter-spacing: 0.5px;
    }

    .content-text p {
        margin-bottom: 12px;
    }

    .font-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
        border: 2px solid #555;
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 30px;
    }
}