/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: url('../assets/底图-剧情简介、阵营选择和文创商城的背景图.jpg') center top;
    background-size: cover;
    background-attachment: scroll;
    min-height: 100vh;
    position: relative;
}

/* 为二级页面添加背景遮罩 */
body.secondary-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 248, 220, 0.9);
    z-index: -1;
}

/* 首页背景：固定于视口、锚定底端，保证图片底部内容始终可见（只裁顶部，不裁底部） */
body.home-page {
    background: none;
}

body.home-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/底图-剧情简介、阵营选择和文创商城的背景图.jpg') center bottom no-repeat;
    background-size: cover;
    z-index: -1;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 414px;
    margin: 0 auto;
    position: relative;
}

/* 主页面样式 */
.main-content {
    flex: 1;
    padding: 20px 16px calc(110px + env(safe-area-inset-bottom));
}

.map-section {
    margin-bottom: 28px;
    text-align: center;
}

.game-title {
    margin-bottom: 20px;
}

.main-title {
    font-size: clamp(28px, 8.5vw, 36px);
    font-weight: 700;
    color: #8b4513;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.sub-title {
    font-size: clamp(13px, 3.8vw, 16px);
    font-weight: 500;
    color: #d2691e;
    margin-bottom: 0;
    letter-spacing: 1px;
    opacity: 0.9;
}

.map-image {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #f5e6a3;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.card h3 {
    font-size: clamp(13px, 3.4vw, 15px);
    color: #8b4513;
    font-weight: 600;
    margin-top: 4px;
    white-space: nowrap;
}

/* 底部导航栏（悬浮胶囊式，适配全面屏安全区域） */
.bottom-nav {
    position: fixed;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 400px;
    background: rgba(255, 248, 220, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #e6d47a;
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    display: flex;
    padding: 6px;
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 16px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-item:hover {
    background: rgba(255, 215, 0, 0.2);
}

.nav-item.active {
    background: rgba(255, 165, 0, 0.3);
    color: #8b4513;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* 二级页面通用样式 */
.page-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 248, 220, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e6d47a;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #8b4513;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: rgba(139, 69, 19, 0.1);
}

.page-header h1 {
    font-size: 20px;
    color: #8b4513;
    font-weight: 600;
}

.page-content {
    flex: 1;
    padding: 20px 16px calc(110px + env(safe-area-inset-bottom));
}

/* 剧情简介页样式 */
.story-image-container {
    margin-bottom: 24px;
    text-align: center;
}

.story-image {
    width: 100%;
    max-width: 380px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.story-text {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #f5e6a3;
}

.story-text p {
    font-size: 16px;
    line-height: 1.8;
    color: #4a4a4a;
    text-align: justify;
}

/* 游玩攻略页样式 */
.guide-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #f5e6a3;
}

.guide-content h2 {
    font-size: 20px;
    color: #8b4513;
    margin-bottom: 20px;
    text-align: center;
}

.guide-section {
    margin-bottom: 24px;
}

.guide-section h3 {
    font-size: 18px;
    color: #d2691e;
    margin-bottom: 12px;
    font-weight: 600;
}

.faction-list {
    margin: 16px 0;
}

.faction-item {
    background: rgba(255, 248, 220, 0.8);
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid #ffa500;
}

.faction-item strong {
    color: #8b4513;
}

.tips {
    background: rgba(255, 215, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
    font-weight: 500;
    color: #8b4513;
}

.guide-section ul {
    margin-left: 20px;
}

.guide-section li {
    margin-bottom: 8px;
    color: #4a4a4a;
}

.farewell {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #8b4513;
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 8px;
}

/* 阵营选择页样式 */
.factions-image-container {
    margin-bottom: 24px;
    text-align: center;
}

.factions-image {
    width: 100%;
    max-width: 380px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.selection-prompt {
    text-align: center;
    margin-bottom: 24px;
}

.selection-prompt h2 {
    font-size: 20px;
    color: #8b4513;
    font-weight: 600;
}

.faction-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.faction-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #f5e6a3;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.faction-btn:hover {
    background: rgba(255, 248, 220, 0.95);
    border-color: #ffa500;
    transform: translateY(-1px);
}

.faction-btn.selected {
    background: rgba(255, 165, 0, 0.2);
    border-color: #ff8c00;
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.3);
}

.faction-name {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #8b4513;
    margin-bottom: 4px;
}

.faction-desc {
    display: block;
    font-size: 14px;
    color: #666;
}

.start-game-container {
    text-align: center;
}

.start-game-btn {
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.start-game-btn:enabled:hover {
    background: linear-gradient(135deg, #ff8c00, #ff7f00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

.start-game-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* 文创商城页样式 */
.shop-banner {
    margin-bottom: 20px;
    text-align: center;
}

.banner-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 商品类目区块 */
.shop-section {
    margin-bottom: 26px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 4px solid #ffa500;
}

.section-header h2 {
    font-size: 18px;
    color: #8b4513;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.section-sub {
    font-size: 11px;
    color: #b8860b;
    font-weight: 500;
    white-space: nowrap;
}

.price-pill {
    flex-shrink: 0;
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
    line-height: 1.4;
}

.price-pill small {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
}

/* 商品网格：默认 3 列（徽章/盲盒），帆布袋 2 列大卡 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.grid-bags {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.product-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #f5e6a3;
    border-radius: 14px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #ffa500;
}

.product-card:active {
    transform: scale(0.97);
}

.product-image {
    border-radius: 8px;
    overflow: hidden;
    background: #fff8dc;
    margin-bottom: 8px;
}

.product-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 2px 2px;
}

.product-name {
    font-size: 13px;
    color: #5a4632;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.product-price {
    font-size: 15px;
    color: #ff8c00;
    font-weight: 700;
}

/* 商品大图浮框 */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.product-modal.show {
    opacity: 1;
    visibility: visible;
}

.product-modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.product-modal-body {
    position: relative;
    width: min(86vw, 400px);
    background: #fff;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.25s ease;
}

.product-modal.show .product-modal-body {
    transform: scale(1);
}

.product-modal-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    background: #fff8dc;
}

.product-modal-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 2px 6px 4px;
}

.product-modal-name {
    font-size: 16px;
    font-weight: 700;
    color: #5a4632;
}

.product-modal-price {
    font-size: 20px;
    font-weight: 800;
    color: #ff8c00;
}

.product-modal-counter {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    letter-spacing: 2px;
}

.product-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #8b4513;
    font-size: 22px;
    line-height: 32px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 3;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.product-modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    padding: 0 0 2px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.product-modal-arrow.prev {
    left: 10px;
}

.product-modal-arrow.next {
    right: 10px;
}

.product-modal-arrow:hover {
    background: rgba(255, 140, 0, 0.85);
}

.product-modal-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
}

@keyframes productSlideIn {
    from {
        opacity: 0.3;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-modal-body.slide-in .product-modal-image {
    animation: productSlideIn 0.22s ease;
}

/* 研学地图放大查看浮层 */
.map-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2100;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.map-viewer.show {
    opacity: 1;
    visibility: visible;
}

.map-viewer-stage {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.map-viewer-image {
    max-width: 94vw;
    max-height: 84vh;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.map-viewer-close {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 24px;
    line-height: 36px;
    padding: 0;
    cursor: pointer;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.map-viewer-controls {
    position: absolute;
    right: 16px;
    bottom: calc(56px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3;
}

.map-viewer-controls button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.map-viewer-controls button:hover {
    background: rgba(255, 140, 0, 0.85);
}

.map-viewer-hint {
    position: absolute;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

/* 阵营选择提示样式 */
.faction-prompt-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.faction-prompt-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid #f5e6a3;
    max-width: 400px;
    width: 100%;
}

.prompt-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.faction-prompt-card h2 {
    font-size: 24px;
    color: #8b4513;
    margin-bottom: 16px;
    font-weight: 600;
}

.faction-prompt-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 16px;
}

.prompt-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.select-faction-btn,
.back-home-btn {
    padding: 14px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.select-faction-btn {
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.3);
}

.select-faction-btn:hover {
    background: linear-gradient(135deg, #ff8c00, #ff7f00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

.back-home-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #8b4513;
    border: 2px solid #f5e6a3;
}

.back-home-btn:hover {
    background: rgba(255, 248, 220, 0.95);
    border-color: #ffa500;
}

/* 探索进度页样式 */
.current-faction {
    background: rgba(255, 255, 255, 0.95);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid #f5e6a3;
}

.current-faction h2 {
    font-size: 18px;
    color: #8b4513;
}

.current-faction span {
    color: #ff8c00;
    font-weight: 600;
}

.progress-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #f5e6a3;
}

.progress-image-container {
    text-align: center;
    margin-bottom: 20px;
}

.progress-image {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 8px;
}

.progress-info h3 {
    font-size: 16px;
    color: #8b4513;
    margin-bottom: 12px;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffa500, #ff8c00);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.clues-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 2px solid #f5e6a3;
}

.clues-section h3 {
    font-size: 18px;
    color: #8b4513;
    margin-bottom: 16px;
}

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

.clue-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #f5e6a3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clue-item:hover {
    border-color: #ffa500;
    transform: scale(1.05);
}

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

.empty-clues-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.empty-clues-message small {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    display: block;
}

.return-home-container {
    text-align: center;
}

.return-home-btn {
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.3);
}

.return-home-btn:hover {
    background: linear-gradient(135deg, #ff8c00, #ff7f00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

/* 平板和桌面端适配 */
@media (min-width: 768px) {
    body {
        background-attachment: fixed;
    }

    .app-container {
        max-width: 768px;
    }

    .main-content {
        padding: 40px 32px calc(120px + env(safe-area-inset-bottom));
    }

    .main-title {
        font-size: 48px;
    }

    .sub-title {
        font-size: 20px;
    }

    .map-image {
        max-width: 520px;
    }

    .feature-cards {
        max-width: 620px;
        gap: 24px;
    }

    .card {
        padding: 16px;
        border-radius: 18px;
    }

    .card h3 {
        font-size: 16px;
    }

    .bottom-nav {
        max-width: 500px;
        padding: 8px;
        border-radius: 26px;
    }

    .nav-item {
        border-radius: 19px;
        padding: 10px 4px;
    }

    .nav-icon {
        width: 26px;
        height: 26px;
    }

    .nav-item span {
        font-size: 13px;
    }

    .page-content {
        padding: 40px 32px calc(120px + env(safe-area-inset-bottom));
    }

    .faction-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* 桌面端商城：徽章/盲盒 5 列单行，钥匙扣 6 列单行 */
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }

    .grid-bags {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .grid-keychains {
        grid-template-columns: repeat(6, 1fr);
    }

    .section-header h2 {
        font-size: 20px;
    }

    .price-pill {
        font-size: 16px;
    }

    .product-name {
        font-size: 14px;
    }

    .product-price {
        font-size: 16px;
    }

    .product-modal-body {
        width: min(80vw, 460px);
    }

    .product-modal-arrow {
        width: 46px;
        height: 46px;
        font-size: 28px;
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 1024px;
    }

    .main-content {
        padding: 60px 48px calc(130px + env(safe-area-inset-bottom));
    }

    .map-image {
        max-width: 620px;
    }

    .feature-cards {
        max-width: 720px;
        gap: 32px;
    }

    .card {
        padding: 20px;
    }

    .card h3 {
        font-size: 18px;
    }

    .bottom-nav {
        max-width: 620px;
    }

    .page-content {
        padding: 60px 48px calc(130px + env(safe-area-inset-bottom));
    }

    .faction-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 线索发现动画样式 */
.clue-discovery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.clue-discovery-overlay.show {
    opacity: 1;
}

.clue-discovery-overlay.hide {
    opacity: 0;
}

.clue-discovery-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.5);
    transition: transform 0.5s ease;
}

.clue-discovery-overlay.show .clue-discovery-container {
    transform: scale(1);
}

.clue-discovery-overlay.hide .clue-discovery-container {
    transform: scale(0.8);
}

.clue-discovery-image {
    width: 82%;
    height: auto;
    border-radius: 12px;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    animation: clueGlow 2s ease-in-out infinite alternate;
}

.clue-glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, rgba(255, 165, 0, 0.2) 40%, transparent 70%);
    z-index: 1;
    animation: glowPulse 1.5s ease-in-out infinite;
}

.clue-discovery-text {
    margin-top: 24px;
    font-size: 24px;
    font-weight: 600;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    text-align: center;
    animation: textGlow 1s ease-in-out infinite alternate;
}

/* 线索发现动画关键帧 */
@keyframes clueGlow {
    0% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
        filter: brightness(1);
    }
    100% {
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.9), 0 0 100px rgba(255, 165, 0, 0.4);
        filter: brightness(1.1);
    }
}

@keyframes glowPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

@keyframes textGlow {
    0% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    }
    100% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 165, 0, 0.8);
    }
}

/* 移动端触摸反馈 */
.card:active,
.faction-btn:active,
.nav-item:active,
.start-game-btn:active,
.product-card:active,
.return-home-btn:active,
.back-btn:active,
.select-faction-btn:active,
.back-home-btn:active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #ffa500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}