﻿/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* 禁止下拉刷新 */
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
    /* 禁止下拉刷新 */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

#app {
    background: linear-gradient(135deg, #820a03, #850c03);
    min-height: 100vh;
}

/* 顶部导航 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #870c04;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    width: 22px;
    height: 22px;
    margin-right: 10px;
}

.logo-text {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 20px;
    transition: all 0.3s;
}

.user-info:hover {
    background: #eeeeee;
}

.user-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.user-balance {
    font-size: 14px;
    font-weight: bold;
    color: #d32f2f;
}

/* 轮播图部分 */
.banner-section {
    position: relative;
    height: 200px;
    margin: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.banner-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    color: white;
}

.banner-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 5px;
}

.banner-desc {
    font-size: 14px;
    opacity: 0.9;
}

.banner-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-indicators span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-indicators span.active {
    background: #d32f2f;
    transform: scale(1.2);
}.user-level {
    font-size: 12px;
    background: #870c04;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}
.username {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}
/* 功能入口部分 */
.features-section {
    margin: 20px;
    background: linear-gradient(180deg, #a92b19, #5a1212);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #fff;   
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.features-grid {
    display: grid; 
    margin-top :20px;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #d32f2f;
}

.feature-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    background: #d32f2f;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon .iconfont {
    font-size:22px;
    filter: brightness(0) invert(1);
}

.feature-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.feature-desc {
    font-size: 12px;
    color: #666;
}

/* 禁用状态样式 */
.feature-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.feature-item.disabled .feature-icon {
    background: #ccc;
}

.feature-item.disabled .feature-name {
    color: #999;
}

.feature-item.disabled .feature-desc {
    color: #bbb;
}

/* 积分商城部分 */
.mall-section {
    padding: 30px 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    cursor: pointer;
}

.section-more {
    color: #fbb82d;
    font-size: 14px;
    font-weight: 500;
}

.mall-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.mall-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* border: 1px solid #f0f0f0; */
}

.mall-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #d32f2f;
}

.mall-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.mall-info {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-items: center;
    justify-content: space-between;
    
}

.mall-name {
    font-size: 14px;
    font-weight: bold;
   
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mall-price {
    font-size: 14px;
    font-weight: bold;
    color: #d32f2f;
}

/* 新闻列表部分 */
.news-section {
    margin: 30px 20px;
    /* padding-bottom: 100px; */
}

.news-list {
    background: white;
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.news-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.3s;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: #fafafa;
}

.news-image {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.news-summary {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
}

/* 底部导航 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.footer-text {
    font-size: 12px;
    color: #666;
}

/* 加载状态 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f5f5f5;
    border-top: 4px solid #d32f2f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #fff;
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 480px) {
    .feature-name{
        font-size: 15px;
    }
    .header {
        padding: 12px 15px;
    }
    .feature-item{
        padding: 10px 5px;
    }
    /* .banner-section {
        height: 160px;
        margin: 15px;
    } */
    
    .features-grid {
        gap: 15px;
    }
    
    
    
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    
    .feature-icon img {
        width: 24px;
        height: 24px;
    }
    
    .mall-preview {
        grid-template-columns: 1fr;
    }
    
    .news-item {
        padding: 12px;
    }
    
    .news-image {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 360px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-item {
        display: flex;
        align-items: center;
        text-align: left;
        padding-left:20px
    }
    
    .feature-icon {
        /* margin-right: 15px; */
        margin-bottom: 0;
    }
}

/* 积分商城副标题 */
.section-subtitle {
    font-size: 14px;
    color: #d32f2f;
    font-weight: 500;
    margin-bottom: 15px;
    text-align: center;
    position: relative;
}

.section-subtitle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
    z-index: 1;
}

.section-subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f5f5f5;
    padding: 0 15px;
    z-index: 2;
}
.user-item{
    position: fixed;
    bottom:50px;
    right: 20px;
    background: #fff;
    border-radius: 100%;
    z-index: 9999;
}

/* 弹窗样式 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-content {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 85%;
    width: 400px;
    min-height: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.popup-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.popup-close:hover {
    background: #f5f5f5;
    color: #666;
}

.popup-body {
    padding: 0 20px 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 120px;
}

.popup-content-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 84px; /* 4行 * 1.5行高 * 14px = 84px */
}

.popup-msg-info {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    background: #f8f9fa;
    padding: 0 12px;
    border-radius: 8px;
    border-left: 4px solid #d32f2f;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 54.6px; /* 3行 * 1.4行高 * 13px = 54.6px */
}

.popup-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.popup-btn {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
}

.popup-btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.popup-btn-secondary:hover {
    background: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.popup-btn:hover {
    background: #b71c1c;
    transform: translateY(-1px);
}

.popup-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .popup-content {
        width: 95%;
        margin: 10px;
        min-height: 250px;
    }
    
    .popup-header {
        padding: 15px 15px 0;
    }
    
    .popup-body {
        padding: 0 15px 15px;
    }
    
    .popup-footer {
        padding: 15px;
    }
    
    .popup-content-text {
        max-height: 90px; /* 移动端稍微增加高度 */
    }
    
    .popup-msg-info {
        max-height: 60px; /* 移动端稍微增加高度 */
    }
}