/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    /* 设置平铺背景 */
    background-image: url('../images/background.jpg');
    background-repeat: repeat;
    background-attachment: scroll; 
    background-position: top left;
    background-color: rgba(255, 255, 255, 0.5);
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 基本链接样式 */
a {
    color: #333;
    text-decoration: none;
}

a:hover {
    color: #000;
    text-decoration: underline;
}

/* 按钮样式 - 使用蓝色 */
button, .button, .btn {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    text-decoration: none !important;
}

button:hover, .button:hover, .btn:hover {
    background-color: #0069d9;
    color: white !important;
    text-decoration: none !important;
}

/* 导航样式 - 改回透明/白色背景 */
.navbar {
    background-color: transparent !important;
    box-shadow: none;
}

.navbar-light .navbar-nav .nav-link {
    color: #333 !important;
}

.navbar-brand {
    color: #333 !important;
}

.nav-link, .dropdown-item {
    text-decoration: none !important;
    padding: 8px 10px;
    color: #333 !important;
    background-color: transparent !important;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.nav-link:hover, .dropdown-item:hover {
    text-decoration: underline !important;
    background-color: rgba(0,0,0,0.05);
}

/* 下拉菜单样式 */
.dropdown-menu {
    background-color: white !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
}

.dropdown-item {
    color: #333 !important;
}

.dropdown-item:hover {
    background-color: rgba(0,0,0,0.05) !important;
    color: #333 !important;
}

/* 确保特定按钮有正确的蓝色/绿色 */
.btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
}

.btn-primary:hover {
    background-color: #0069d9 !important;
    border-color: #0062cc !important;
}

.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.btn-success:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

/* 卡片中的链接按钮 */
.card a.btn, .memorial-card a.btn {
    display: inline-block !important;
    padding: 10px 15px !important;
    background-color: #007bff !important;
    color: white !important;
    border-radius: 4px !important;
    text-decoration: none !important;
}

/* memorial-link样式 */
.memorial-link {
    display: inline-block !important;
    padding: 8px 15px !important;
    background-color: #007bff !important;
    color: white !important;
    border-radius: 4px !important;
    text-decoration: none !important;
}

.memorial-link:hover {
    background-color: #0069d9 !important;
    text-decoration: none !important;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    margin-top: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 头部样式 */
header {
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    text-align: center;
    padding: 30px 0;
}

.header-content h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

/* 导航栏样式 */
.nav-bar {
    background-color: rgba(68, 68, 68, 0.9);
    padding: 10px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-links a {
    color: white;
    margin-right: 20px;
    text-decoration: none;
}

.nav-links a:hover {
    text-decoration: underline;
}

.user-menu {
    display: flex;
    align-items: center;
}

/* 菜单样式 */
.user-menu a {
    color: white;
    margin-left: 15px;
    text-decoration: none;
    background: transparent;
}

.user-name {
    color: #ddd;
    margin-right: 15px;
}

.admin-link {
    padding: 5px 10px;
    border-radius: 3px;
    background-color: transparent;
    border: 1px solid rgba(255,255,255,0.3);
}

.admin-link:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.page-title {
    font-size: 28px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* 消息提示 */
.flash-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.flash-message.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.flash-message.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.flash-message.info {
    background-color: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

/* 首页样式 */
.home-container {
    margin: 20px 0;
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.memorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.memorial-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.memorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.memorial-photo {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: #f8f9fa;
}

.memorial-info {
    padding: 15px;
}

.memorial-name {
    font-weight: bold;
    margin: 0 0 5px 0;
    font-size: 18px;
}

.memorial-dates {
    color: #666;
    font-size: 14px;
    margin: 0 0 10px 0;
}

.memorial-link:hover {
    background-color: #5a6268;
    text-decoration: none;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #666;
}

/* 表单样式 */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* 底部样式 */
footer {
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }
    
    .nav-links, .user-menu {
        margin-top: 10px;
    }
    
    .memorial-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .memorial-grid {
        grid-template-columns: 1fr;
    }
}

/* 所有卡片类元素 */
.card, .memorial-card, .message-card {
    background-color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 15px;
}

/* 强制设置窗口最小高度，确保短页面也有完整背景 */
html, body {
    min-height: 100vh;
}

/* 墓志铭样式 */
.epitaph-container {
    width: 100%;
    padding: 2px;
    background-color: rgba(245, 245, 245, 0.95) !important;
    border-radius: 5px;
    margin: 15px auto;
    box-sizing: border-box;
}

.epitaph-content {
    width: 100%;
    line-height: 0.375;
    word-break: break-word;
    font-family: "SimSun", "宋体", serif;
    color: #333;
    text-align: center;
    letter-spacing: 1px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

/* 墓志铭行样式 */
.epitaph-line {
    width: calc(100% - 2px);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    display: block;
    font-size: min(5.2vw, 30px);
    text-align: center;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .epitaph-line {
        font-size: min(3.5vw, 30px);
        line-height: 1.5;
        width: calc(100% - 4px);
    }
}

@media (max-width: 576px) {
    .epitaph-line {
        font-size: min(6.5vw, 28px);
        line-height: 1.5;
        width: 100%;
    }
}

/* 画卷式墓志铭样式 - 纯CSS实现 */
.scroll-epitaph-container {
    position: relative;
    padding: 25px 0;
    margin: 20px auto;
    width: 95%;
    max-width: 480px;
    overflow: hidden;
    background-color: #f5efd7; /* 更接近截图中的淡黄色 */
    box-shadow: none;
    border: none;
    border-radius: 0;
    /* 关键：添加边框设置为0 */
    border-left: 0;
    border-right: 0;
}

/* 确保卷轴没有任何边框 */
.scroll-epitaph-container:before,
.scroll-epitaph-container:after {
    display: none !important;
}

/* 卷轴内容 */
.scroll-epitaph-content {
    position: relative;
    z-index: 2;
    padding: 5px 15px 20px;
    font-family: 'FangSong', 'SimSun', serif;
    color: #333;
    text-align: center;
    line-height: 1.8;
    background-color: #f5efd7;
    background-image: none;
}

/* 顶部画卷边缘 */
.scroll-epitaph-top-edge {
    content: '';
    position: absolute;
    height: 20px;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(to bottom, 
        #ddc693 0%, 
        #e6d4a8 40%,
        #f0e5c0 70%, 
        #f5efd7 100%);
    border-bottom: 1px solid #ddc693;
    box-shadow: inset 0 -3px 6px -4px rgba(0,0,0,0.2);
    z-index: 3;
}

/* 底部画卷边缘 */
.scroll-epitaph-bottom-edge {
    content: '';
    position: absolute;
    height: 20px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, 
        #ddc693 0%, 
        #e6d4a8 40%,
        #f0e5c0 70%, 
        #f5efd7 100%);
    border-top: 1px solid #ddc693;
    box-shadow: inset 0 3px 6px -4px rgba(0,0,0,0.2);
    z-index: 3;
}

.scroll-epitaph-line {
    margin-bottom: 8px;
    text-indent: 0;
    position: relative;
    z-index: 5;
    font-size: 16px;
    line-height: 1.8;
}

.scroll-epitaph-title {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0 auto 15px;
    color: #8B4513;
    text-align: center;
    text-indent: 0;
    border-bottom: 1px solid #d9c7a7;
    padding-bottom: 10px;
    width: 70%;
    position: relative;
    z-index: 5;
}

/* 移除装饰星号，因为已经在HTML中添加 */
.scroll-epitaph-title:before,
.scroll-epitaph-title:after {
    display: none;
}

/* 印章装饰 */
.scroll-epitaph-seal {
    position: absolute;
    right: 20px;
    bottom: 35px;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 0, 0, 0.12);
    border-radius: 2px;
    transform: rotate(15deg);
    opacity: 0.8;
    box-shadow: 0 0 3px rgba(255, 0, 0, 0.2);
    z-index: 4;
}

/* 移动设备上的样式调整 */
@media (max-width: 768px) {
    .scroll-epitaph-container {
        width: 95%;
    }
    
    .scroll-epitaph-seal {
        width: 50px;
        height: 50px;
        right: 15px;
        bottom: 30px;
    }
    
    .scroll-epitaph-line {
        font-size: 14px;
    }
}

/* 虚拟墓地祭拜区样式 */
.virtual-grave-scene {
    margin-bottom: 20px;
}

.grave-scene {
    position: relative;
    width: 100%;
    height: 300px;
    background-image: url('../images/grave-background.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.grave-items-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none; /* 使容器不阻挡底层墓地的点击事件 */
}

.tombstone {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 180px;
    background-color: #9e9e9e;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    text-align: center;
    color: #333;
    z-index: 5;
}

.tombstone:before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px 5px 0 0;
}

.tombstone-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: #000;
}

.tombstone-dates {
    font-size: 12px;
    color: #333;
}

.offering-selection {
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 5px;
    margin-top: 15px;
}

.offering-item {
    cursor: grab;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s;
}

.offering-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.offering-item img {
    max-height: 60px;
    margin-bottom: 5px;
}

.offering-item p {
    margin: 0;
    font-size: 12px;
}

/* 墓地上的贡品样式 */
.placed-offering {
    position: absolute;
    width: 50px;
    height: 50px;
    cursor: move;
    z-index: 15;
    pointer-events: auto; /* 恢复贡品自身的点击和拖动功能 */
    transition: transform 0.2s;
}

.placed-offering:hover {
    transform: scale(1.1);
    z-index: 20;
}

.placed-offering img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

/* 拖动贡品时的样式 */
.placed-offering.dragging {
    opacity: 0.8;
    z-index: 100;
}

/* 其他控制按钮样式 */
.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 拖动中的效果 */
.offering-item.dragging {
    opacity: 0.7;
}

/* 购买贡品弹窗样式 */
.offering-purchase-modal .modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.purchase-item {
    width: 120px;
    text-align: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    transition: all 0.2s;
}

.purchase-item:hover {
    border-color: #6c757d;
    transform: translateY(-3px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.purchase-item img {
    max-height: 70px;
    margin-bottom: 10px;
}

.purchase-item .item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.purchase-item .item-price {
    color: #e53935;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .grave-scene {
        height: 250px;
    }
    
    .tombstone {
        width: 120px;
        height: 150px;
        bottom: 30px;
    }
    
    .offering-item img {
        max-height: 50px;
    }
    
    .placed-offering {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .grave-scene {
        height: 200px;
    }
    
    .tombstone {
        width: 100px;
        height: 130px;
        bottom: 20px;
        padding: 10px;
    }
    
    .tombstone-name {
        font-size: 14px;
    }
    
    .tombstone-dates {
        font-size: 10px;
    }
    
    .offering-item img {
        max-height: 40px;
    }
    
    .placed-offering {
        width: 35px;
        height: 35px;
    }
}

/* 如果有使用max-content的地方，确保兼容性 */
.width-max-content, .nav-item, .dropdown-menu {
    width: -webkit-max-content;
    width: -moz-max-content;
    width: max-content;
} 