/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    color: #667eea;
    font-size: 1.5rem;
}

/* 移动端汉堡菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
    transition: all 0.3s;
}

.nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-link:hover {
    background: #667eea;
    color: white;
}

/* 主内容区 */
.main-content {
    padding: 40px 0;
}

.section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.section-title {
    color: #667eea;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    min-height: 44px;
    min-width: 44px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-edit:hover {
    background: #e67e22;
}

.btn-edit:active {
    transform: scale(0.98);
}

/* 个人简介卡片 */
.profile-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.avatar {
    width: 150px;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: white;
    /* 移除图片显示，改用背景和 emoji */
    background-image: none;
}

/* 头像上传提示 */
.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar-upload-hint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
    padding: 5px;
}

.avatar-container:hover .avatar-upload-hint {
    opacity: 1;
}

/* 裁剪模态框样式 */
.crop-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.crop-modal.active {
    display: flex;
}

.crop-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.crop-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.crop-canvas-container {
    width: 100%;
    height: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-canvas-container canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: grab;
    touch-action: none;
}

.crop-canvas-container canvas:active {
    cursor: grabbing;
}

.crop-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.crop-controls button {
    min-width: 80px;
}

.crop-zoom-slider {
    width: 100%;
    margin-bottom: 15px;
}

.crop-zoom-slider label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.crop-zoom-slider input {
    width: 100%;
    cursor: pointer;
}

/* 视频网格样式 - 支持竖屏视频，移动端优化 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.video-item video {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    max-height: 600px;
    flex-shrink: 0;
}

.video-item .video-info {
    padding: 12px 10px;
    background: #f8f9fa;
    color: #666;
    font-size: 13px;
    text-align: center;
    flex-shrink: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-item .video-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: all 0.3s;
}

.video-item .video-delete:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

/* 上传进度提示 */
.upload-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    z-index: 4000;
    text-align: center;
}

.upload-progress-bar {
    width: 200px;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 15px 0;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

/* Toast 动画 */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

.profile-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.profile-info p {
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-content {
    background: white;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.8;
}

/* 照片视频画廊 */
.gallery-controls {
    margin-bottom: 20px;
}

.gallery-controls .btn {
    min-width: 120px;
}

.photo-grid, .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    min-height: 200px;
}

.photo-item, .video-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
}

.photo-item:hover, .video-item:hover {
    transform: scale(1.05);
}

.photo-item img, .video-item video {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* 照片占位符样式 - 无照片时显示背景色 + 文字 */
.photo-placeholder {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    min-height: 200px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.placeholder-text {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.95;
    letter-spacing: 2px;
}

/* 照片删除按钮样式 */
.photo-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.3s;
    z-index: 10;
}

.photo-delete-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

/* 祭祀区域 */
.worship-area {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.worship-items {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.worship-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.worship-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.worship-item:active {
    transform: scale(0.95);
}

/* 祭祀动画 - 浮动效果 */
.worship-item.animate {
    animation: worshipBounce 0.6s ease-out;
}

@keyframes worshipBounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15) translateY(-10px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

/* 粒子效果容器 */
.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* 单个粒子 */
.particle {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: particleFloat 1s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

/* 计数器数字增长动画 */
.item-count {
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    transition: color 0.3s;
}

.item-count.counting {
    animation: countPulse 0.3s ease-in-out;
    color: #f39c12;
}

@keyframes countPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* 光芒效果 */
.worship-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.worship-item.ripple::after {
    width: 300px;
    height: 300px;
    opacity: 0;
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

.worship-message textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: inherit;
}

/* 留言板块 */
.message-board {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.message-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.message-form textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 16px;
}

.form-options {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-options label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-options input[type="radio"] {
    width: 18px;
    height: 18px;
}

.form-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-inputs input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    min-height: 44px;
}

.message-list {
    max-height: 500px;
    overflow-y: auto;
}

.message-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9rem;
}

.message-content {
    line-height: 1.6;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-body {
    margin-top: 20px;
}

#modal-body input,
#modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    font-family: inherit;
}

/* 登录注册表单样式 */
#modal-body input[type="email"],
#modal-body input[type="password"],
#modal-body input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 16px;
}

#modal-body input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

#modal-body label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

#send-code-btn {
    min-width: 130px;
    font-size: 14px;
    padding: 12px 15px;
}

#modal-body a {
    color: #667eea;
    text-decoration: none;
}

#modal-body a:hover {
    text-decoration: underline;
}

/* 页脚 */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* 首页 Banner */
.hero-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    color: white;
    margin-bottom: 40px;
    /* 备用背景色，当 hero-bg.jpg 不存在时使用渐变 */
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

/* 纪念馆网格 */
.memorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* 纪念馆卡片 */
.memorial-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.memorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.memorial-avatar {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.memorial-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background: #667eea;
}

/* 新增：纪念馆列表头像姓氏显示样式 */
.memorial-avatar .surname {
    font-size: 60px;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    /* 新增：添加圆形外框样式 */
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    /* 确保文字居中 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 新增：纪念馆详情页头像竖向文字样式 */
.avatar-vertical-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 24px;
    color: white;
    letter-spacing: 8px;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图片加载失败时显示备用内容 */
.memorial-avatar img[src=""], 
.memorial-avatar img:not([src]),
.memorial-avatar img[onerror] {
    display: none;
}

.memorial-info {
    padding: 20px;
}

.memorial-info h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.memorial-dates {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.memorial-desc {
    color: #888;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.memorial-stats {
    color: #667eea;
    font-size: 0.85rem;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.memorial-enter {
    background: #667eea;
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.memorial-card:hover .memorial-enter {
    background: #5568d3;
}

/* 关于我们特色 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-item h3 {
    color: #333;
    margin-bottom: 10px;
}

.feature-item p {
    color: #666;
    font-size: 0.9rem;
}

/* 使用指南步骤 */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h3 {
    color: #333;
    margin-bottom: 5px;
}

.step-content p {
    color: #666;
    font-size: 0.95rem;
}

/* 联系我们 */
.contact-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.contact-info p {
    margin-bottom: 10px;
    color: #666;
}

/* 分页器样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 15px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
}

.pagination-ellipsis {
    color: #666;
    padding: 0 5px;
}

.pagination-info {
    color: #666;
    font-size: 13px;
    margin-left: 10px;
}

/* 照片网格区域添加分页容器 */
#photo-grid {
    min-height: 200px;
}

#photo-pagination {
    border-top: 1px solid #eee;
    margin-top: 15px;
    padding-top: 15px;
}


#message-pagination {
    border-top: 1px solid #eee;
    margin-top: 15px;
    padding-top: 15px;
}

/* 响应式设计 - 平板 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .menu-toggle {
        display: flex;
        position: absolute;
        right: 20px;
        top: 20px;
    }
    
    .nav {
        flex-direction: column;
        width: 100%;
        display: none;
        gap: 10px;
        padding: 15px 0;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav-link {
        display: block;
        padding: 12px 20px;
        text-align: center;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-info p {
        white-space: normal;
        font-size: 0.9rem;
    }

    .worship-items {
        flex-direction: column;
        align-items: center;
    }
    
    .worship-item {
        width: 100%;
        max-width: 300px;
    }
    
    .form-inputs {
        flex-direction: column;
    }
    
    .photo-grid, .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .section {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .tree-controls {
        gap: 8px;
    }
    
    .tree-controls .btn {
        min-width: 80px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .memorial-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guide-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* 响应式设计 - 手机 */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .menu-toggle {
        right: 10px;
        top: 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .avatar {
        width: 120px;
        height: 160px;
    }
    
    .profile-info h3 {
        font-size: 1.2rem;
    }
    
    .profile-info p {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
    }
    
    .photo-grid, .video-grid {
        grid-template-columns: 1fr;
    }
    
    /* 移动端删除按钮始终可见 */
    .photo-delete-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .worship-item {
        padding: 15px;
    }
    
    .item-icon {
        font-size: 2rem;
    }
    
    /* 手机端优化动画 */
    .worship-item.animate {
        animation: worshipBounceMobile 0.5s ease-out;
    }
    
    @keyframes worshipBounceMobile {
        0% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1) translateY(-8px);
        }
        100% {
            transform: scale(1) translateY(0);
        }
    }
    
    .particle {
        font-size: 16px;
    }
    
    @keyframes particleFloat {
        0% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
        100% {
            opacity: 0;
            transform: translateY(-80px) scale(0.5);
        }
    }
    
    .hero-section {
        padding: 30px 15px;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .memorial-grid {
        grid-template-columns: 1fr;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .btn-large {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .crop-container {
        padding: 15px;
        width: 95%;
    }
    
    .crop-canvas-container {
        height: 250px;
    }
    
    .crop-controls button {
        min-width: 70px;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    /* 移动端删除按钮始终可见且更大 */
    .video-item .video-delete {
        width: 40px;
        height: 40px;
        font-size: 20px;
        opacity: 1;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .nav-link:hover {
        background: transparent;
    }
    
    .nav-link:active {
        background: #667eea;
        color: white;
    }
    
    .worship-item:hover {
        transform: none;
    }
    
    .worship-item:active {
        transform: scale(0.95);
    }
    
    .photo-item:hover, .video-item:hover {
        transform: none;
    }
    
    .photo-item:active, .video-item:active {
        transform: scale(0.98);
    }
    
    .video-item .video-delete:hover {
        transform: scale(1.1);
    }
    
    .video-item .video-delete:active {
        transform: scale(0.95);
    }
}

/* 防止 iOS 缩放 */
input, textarea, select {
    font-size: 16px;
}

/* 优化滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}
