/**
 * 黄山文物电子导览系统 - V3 统一样式表
 * 风格：古朴纸质感 + 金棕色调 + 宋体衬线
 */

/* ========== 根变量 ========== */
:root {
    --bg-paper: #F9F7F1;
    --bg-card: #FFFFFF;
    --theme-gold: #C69C6D;
    --theme-brown: #5C4033;
    --theme-brown-light: #8B7355;
    --text-primary: #2C2C2C;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-light: rgba(0, 0, 0, 0.06);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.12);
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
    --tabbar-height: 60px;
}

/* ========== 基础重置 ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
    background: var(--bg-paper);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 20px);
    /* 纸质纹理背景 */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ========== 首页头部 ========== */
.header-section {
    background: linear-gradient(180deg, #E8E4DA 0%, var(--bg-paper) 100%);
    padding: calc(var(--safe-top) + 20px) 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.app-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--theme-brown);
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 10px;
    color: var(--theme-brown-light);
    letter-spacing: 2px;
    opacity: 0.7;
}

.cloud-deco {
    position: absolute;
    top: 20%;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'%3E%3Cpath d='M0,30 Q150,0 300,30 T600,30 T900,30 T1200,30' fill='none' stroke='%23C69C6D' stroke-width='1' opacity='0.2'/%3E%3C/svg%3E") repeat-x center;
    opacity: 0.5;
}

.header-illustration {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.illustration-img {
    width: 160px;
    height: auto;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(92, 64, 51, 0.2));
}

/* ========== 导航网格 (四宫格) ========== */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-item:active {
    transform: scale(0.96);
}

.nav-icon-wrapper {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* SVG 图标样式 */
svg.icon-img {
    width: 48px;
    height: 48px;
}

svg.illustration-img {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(92, 64, 51, 0.2));
}

.icon-speak-text {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    font-family: "Ma Shan Zheng", cursive;
}

.nav-label {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* ========== 搜索框 ========== */
.search-container {
    padding: 20px 16px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 24px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-light);
}

.search-input-wrapper i {
    color: var(--theme-gold);
    font-size: 18px;
    margin-right: 12px;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* ========== 区块标题 ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px 12px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-brown);
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    border-radius: 2px;
}

.section-more {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-more i {
    font-size: 12px;
}

/* ========== 互动体验区 ========== */
.interaction-section {
    padding: 0 16px;
}

.interaction-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.interaction-item {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.interaction-item:active {
    transform: scale(0.98);
}

.interact-text-col {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.4;
}

.interact-title-col {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-brown);
}

.interact-circle {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--theme-gold);
    opacity: 0.9;
}

.interact-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== 推荐探索 (横向滚动卡片) ========== */
.recommend-section {
    margin-top: 8px;
}

.recommend-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 16px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.recommend-scroll::-webkit-scrollbar {
    display: none;
}

.recommend-card {
    flex: 0 0 160px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
}

.recommend-card:active {
    transform: scale(0.98);
}

.card-img-wrapper {
    position: relative;
    height: 200px;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.like-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.like-tag i {
    color: #FF6B6B;
}

.card-info {
    padding: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-brown);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-loc {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-loc i {
    color: var(--theme-gold);
}

/* ========== 世界遗产区 ========== */
.heritage-section {
    margin-top: 8px;
}

.heritage-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    padding: 0 16px;
}

.heritage-lg, .heritage-sm {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.heritage-lg {
    height: 180px;
}

.heritage-sm {
    height: 180px;
}

.heritage-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.heritage-tag-float {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}

.heritage-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.heritage-info-overlay i {
    color: var(--theme-gold);
}

/* ========== 快捷服务列表 ========== */
.services-section {
    margin-top: 20px;
    padding-bottom: 20px;
}

.services-list {
    padding: 0 16px;
}

.service-row {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.service-row:active {
    transform: scale(0.99);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.service-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 20px;
}

.service-row.style-1 .service-icon-box {
    background: linear-gradient(135deg, #FFE4C4 0%, #FFDAB9 100%);
    color: var(--theme-brown);
}

.service-row.style-2 .service-icon-box {
    background: linear-gradient(135deg, #E6F3E6 0%, #D4EDDA 100%);
    color: #28a745;
}

.service-row.style-3 .service-icon-box {
    background: linear-gradient(135deg, #D4EDDA 0%, #C3E6CB 100%);
    color: #07c160;
}

.service-row.style-4 .service-icon-box {
    background: linear-gradient(135deg, #E8E4DA 0%, #DDD9CF 100%);
    color: var(--theme-brown);
}

.service-text {
    flex: 1;
}

.service-h {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.service-p {
    font-size: 12px;
    color: var(--text-muted);
}

.service-arrow {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== 底部 TabBar ========== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tabbar-height);
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 10px;
    transition: color 0.2s;
}

.tab-item .tab-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: var(--theme-gold);
}

.tab-item.active .tab-icon {
    color: var(--theme-gold);
}

/* ========== 子页面通用头部 ========== */
.page-header {
    display: flex;
    align-items: center;
    padding: calc(var(--safe-top) + 12px) 16px 12px;
    background: var(--bg-paper);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-right: 12px;
    color: var(--theme-brown);
    font-size: 18px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-brown);
}

/* ========== 子页面内容区 ========== */
.page-content {
    padding: 0 16px 20px;
}

/* ========== 筛选标签滚动 ========== */
.filter-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

.filter-tag {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    white-space: nowrap;
    transition: all 0.2s;
    cursor: pointer;
}

.filter-tag.active {
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    color: #fff;
    border-color: transparent;
}

/* ========== 网格列表 ========== */
.grid-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
}

/* ========== 垂直列表 ========== */
.vertical-list {
    padding: 0 16px;
}

.list-card {
    display: flex;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.list-card-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

.list-card-content {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.list-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-card-meta i {
    color: var(--theme-gold);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ========== 媒体卡片 (视频/图片) ========== */
.media-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.media-cover {
    position: relative;
    height: 180px;
}

.media-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--theme-brown);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.media-info {
    padding: 16px;
}

.media-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.media-tag {
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
}

.media-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.media-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.media-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-paper);
    width: 100%;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.modal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 3px solid var(--theme-gold);
}

.modal-name {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--theme-brown);
    margin-bottom: 4px;
}

.modal-title-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-video-placeholder {
    background: #000;
    border-radius: 12px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.modal-video-placeholder i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.8);
}

.modal-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-tag-item {
    background: rgba(198, 156, 109, 0.15);
    color: var(--theme-brown);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
}

/* ========== 讲解员卡片 ========== */
.guide-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.guide-avatar-small {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 14px;
    border: 2px solid var(--theme-gold);
}

.guide-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.guide-name-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.guide-badge {
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.guide-desc-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========== 地图页面特定 ========== */
#map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.map-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: calc(var(--safe-top) + 12px) 16px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(10px);
}

.map-controls {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 20px;
    color: var(--theme-brown);
}

.control-btn.active {
    background: var(--theme-brown);
    color: #fff;
}

/* 底部面板 */
.bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 60vh;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-panel.collapsed {
    transform: translateY(calc(100% - 130px));
}

.panel-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto;
    cursor: pointer;
}

/* 地图标记 (Leaflet 自定义) */
.custom-marker {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
}

.custom-marker i {
    transform: rotate(45deg);
    color: #fff;
    font-size: 16px;
}

/* 手绘地图覆盖层 */
.hand-drawn-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    background: #F9F7F1;
}

.hand-drawn-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ========== 故事页面特定 ========== */
.story-header {
    background: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' x2='0' y1='0' y2='1'%3E%3Cstop offset='0' stop-color='%23E6E2D8'/%3E%3Cstop offset='1' stop-color='%23F9F7F1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23a)'/%3E%3C/svg%3E");
    padding: calc(var(--safe-top) + 20px) 20px 40px;
    text-align: center;
}

.story-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: row;
    height: 120px;
}

.story-img {
    width: 120px;
    height: 100%;
    object-fit: cover;
}

.story-content {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.read-modal {
    background: #FDFBF5;
}

.read-text {
    font-family: "Noto Serif SC", serif;
    line-height: 2;
    font-size: 17px;
    color: #2C2C2C;
}

/* ========== 保护/答题页面 ========== */
.knowledge-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.game-option {
    padding: 16px;
    background: #fff;
    border: 2px solid #E0D6C8;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
    font-weight: bold;
    color: var(--theme-brown);
    cursor: pointer;
}

.game-option.selected {
    border-color: var(--theme-gold);
    background: #FDFBF5;
}

.game-option.correct {
    border-color: #28a745;
    background: #d4edda;
}

.game-option.wrong {
    border-color: #dc3545;
    background: #f8d7da;
}

/* ========== 详情页 ========== */
.detail-hero {
    height: 360px;
    position: relative;
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-hero .back-btn {
    position: absolute;
    top: calc(var(--safe-top) + 12px);
    left: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
}

.detail-content-card {
    position: relative;
    margin-top: -40px;
    background: var(--bg-paper);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px;
    min-height: 50vh;
}

.detail-audio-player {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
    border: 1px solid rgba(198, 156, 109, 0.2);
}

/* ========== 革命文物红色主题 ========== */
.red-theme-header {
    background: linear-gradient(135deg, #8B0000 0%, #B22222 100%);
    padding: calc(var(--safe-top) + 20px) 20px 40px;
    color: #fff;
    text-align: center;
}

.red-theme-header .page-title {
    color: #fff;
}

.red-theme-header .back-btn {
    position: absolute;
    left: 16px;
    top: calc(var(--safe-top) + 12px);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ========== 响应式适配 ========== */
@media (min-width: 768px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .tabbar {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.4s ease;
}

/* ========== 工具类 ========== */
.hidden {
    display: none !important;
}

/* ========== 子页面头部样式 ========== */
.header-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: var(--theme-brown);
    font-size: 18px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-brown);
}

/* ========== 模态框显示状态 ========== */
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

/* ========== 讲解员详情样式 ========== */
.guide-info {
    flex: 1;
    min-width: 0;
}

.modal-video-placeholder {
    position: relative;
    background: #000;
    border-radius: 12px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
}

.modal-video-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.modal-video-placeholder i {
    position: absolute;
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
}

/* ========== 媒体标签样式 ========== */
.media-tag.primary {
    background: linear-gradient(135deg, var(--theme-gold) 0%, var(--theme-brown) 100%);
    color: #fff;
}

/* ========== 空状态图标 ========== */
.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    opacity: 0.5;
    display: block;
    margin-bottom: 16px;
}
