/**
 * 纪念详情页样式增强
 * 用于渐进式改进 view.php 的视觉效果
 */

/* === 左侧栏优化 === */
.memorial-container .col-lg-3,
.memorial-container .col-md-4 {
    position: static;
}

.sticky-top {
    position: sticky;
    top: 20px;
    z-index: 100;
}

/* 头像圆角和阴影 */
.memorial-container img[src*="default-"] {
    opacity: 0.85;
}

/* === Tab导航优化 === */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    background: white;
    padding: 0 15px 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-bottom: 0 !important;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-light);
    background: transparent;
    padding: 12px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Tab内容区 */
.tab-content {
    min-height: 400px;
    border-top-left-radius: 0 !important;
}

/* === 相册网格优化 === */
.gallery {
    margin: -10px;
}

.gallery > [class*="col-"] {
    padding: 10px;
}

.gallery .card {
    height: 100%;
    margin: 0;
    transition: var(--transition);
    border: none;
    box-shadow: var(--shadow-sm);
}

.gallery .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.gallery .card-img-top {
    aspect-ratio: 1;
    object-fit: cover;
}

/* === 留言板优化 === */
.message-list {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f0f0f0;
}

.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.message-item {
    transition: background-color 0.2s;
}

.message-item:hover {
    background-color: var(--bg-light);
}

.message-content {
    word-wrap: break-word;
    overflow: hidden;
}

/* === 祭品摆放区优化 === */
.tribute-row {
    background: var(--bg-light);
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 12px !important;
}

.tribute-row .offering-item {
    transition: transform 0.2s;
}

.tribute-row .offering-item:hover {
    transform: scale(1.1);
}

.tribute-row .offering-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: white;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

/* === 全景查看器 === */
#panorama-viewer {
    min-height: 400px;
    background: #000;
    border-radius: var(--radius-md);
}

/* === 地图容器 === */
#map-container {
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* === 模态框优化 === */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* === 响应式调整 === */
@media (max-width: 768px) {
    .sticky-top {
        position: static !important;
    }

    .nav-tabs {
        padding-right: 0;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .tab-content {
        min-height: auto;
    }

    .gallery .card-img-top {
        aspect-ratio: auto;
        height: 180px;
    }
}

/* === 加载状态 === */
.message-list:empty::after {
    content: '暂无留言';
    display: block;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* 虑化加载 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}
