/* CSS变量：统一管理颜色和尺寸，减少重复 */
:root {
    --primary-color: #F44336;
    --secondary-color: #007bff;
    --text-color: #333;
    --text-gray: #666;
    --light-gray: #f5f5f5;
    --card-shadow: 0 3px 6px 0 rgb(0 0 0 / 12%);
    --hover-shadow: 0px 0px 5px 0 var(--primary-color);
    --transition: all .5s;
}

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

/* 图片懒加载基础样式 */
.home-img, .article-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--light-gray);
    background-image: linear-gradient(45deg, #f0f0f0 25%, #fff 25%, #fff 50%, #f0f0f0 50%, #f0f0f0 75%, #fff 75%, #fff 100%);
    background-size: 20px 20px;
    min-height: 100px;
    display: block;
}

/* 移动端图片容器 */
@media screen and (max-width: 769px) {
    .home-img { min-height: 80px; }
}

/* 图片加载状态 */
.home-img img, .article-thumbnail {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.home-img img.loaded, .article-thumbnail.loaded {
    opacity: 1;
    animation: fadeInLoaded 0.5s ease-out;
}

@keyframes fadeInLoaded {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 角标样式（合并重复规则） */
.corner-mark {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    margin-right: 5px;
    margin-top: 5px;
    position: absolute;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}
.corner-mark.hot { background: linear-gradient(45deg, #ff4757, #ff6b7a); }
.corner-mark.new { background: linear-gradient(45deg, #3742fa, #5352ed); }
.corner-mark.recommend { background: linear-gradient(45deg, #ffa502, #ff6348); }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 卡片样式（合并重复） */
.home-card, .choose-us-card {
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: default;
    background: linear-gradient(#f3f5f9, #ffffff);
    border: 2px solid #fff;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}
.home-card:hover, .choose-us-card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-3px);
}

/* 业务数据样式 */
.business-data-container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.business-data-card {
    flex: 1;
    min-width: 120px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    text-align: center;
}
.business-data-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
}
.business-data-label {
    font-size: 14px;
    color: var(--text-gray);
}

/* 用户评价样式 */
.user-reviews-container {
    margin: 30px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}
.reviews-header { text-align: center; margin-bottom: 15px; }
.reviews-title { font-size: 18px; font-weight: bold; color: var(--text-color); }
.reviews-desc { font-size: 14px; color: var(--text-gray); margin-top: 5px; }
.reviews-list { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }
.review-card {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}
.review-stars { color: #ffa502; font-size: 16px; margin-bottom: 8px; }
.review-content { font-size: 14px; color: var(--text-color); margin-bottom: 8px; line-height: 1.5; }
.review-user { font-size: 12px; color: var(--text-gray); text-align: right; }

/* 为什么选择我们样式 */
.choose-us-container {
    margin: 30px 0;
    padding: 20px 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}
.choose-us-header { text-align: center; margin-bottom: 25px; }
.choose-us-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}
.choose-us-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, var(--secondary-color), #4299e1);
    border-radius: 3px;
}
.choose-us-desc { font-size: 14px; color: var(--text-gray); margin-top: 10px; }
.choose-us-list { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.choose-us-card {
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    padding: 25px 15px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}
.choose-us-card:nth-child(1) { animation-delay: 0.1s; }
.choose-us-card:nth-child(2) { animation-delay: 0.2s; }
.choose-us-card:nth-child(3) { animation-delay: 0.3s; }
.choose-us-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.choose-us-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #f0f8fb;
    border-radius: 50%;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-size: 28px;
}
.choose-us-card:hover .choose-us-icon {
    transform: rotate(10deg) scale(1.1);
    background: #e8f4f8;
}
.choose-us-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}
.choose-us-card:hover .choose-us-card-title { color: var(--secondary-color); }
.choose-us-card-desc {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.6;
    transition: all 0.3s ease;
}
.choose-us-card:hover .choose-us-card-desc { color: var(--text-color); }

/* 购买记录样式（精简） */
.purchase-records-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    border: 1px solid #f0f0f0;
    animation: slideInFromRight 0.6s ease-out;
}
@media screen and (max-width: 768px) {
    .purchase-records-fixed { display: none !important; }
}
@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.purchase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}
.purchase-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}
.purchase-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    background-color: #f0f8fb;
    color: #4299e1;
    font-weight: 500;
}
.close-purchase-btn {
    width: 24px;
    height: 24px;
    background: #f8f8f8;
    border: none;
    border-radius: 50%;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}
.close-purchase-btn:hover {
    background: #f0f0f0;
    color: #666;
}
.purchase-list {
    height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}
.purchase-list::-webkit-scrollbar { width: 4px; }
.purchase-list::-webkit-scrollbar-track { background: #f8f8f8; border-radius: 2px; }
.purchase-list::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 2px; }
.purchase-item {
    background: #fafafa;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #f5f5f5;
    transition: all 0.2s ease;
}
.purchase-item:hover {
    border-color: #e8f4f8;
    background-color: #f8fdfd;
}
.purchase-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.purchase-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}
.purchase-avatar {
    width: 20px;
    height: 20px;
    background: #e8f4f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #4299e1;
}
.purchase-time { font-size: 10px; color: #999; }
.purchase-product {
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #f0f0f0;
}
.purchase-product-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-color);
    text-decoration: none;
}
.purchase-product-link:hover { color: #4299e1; }
.purchase-product-icon { font-size: 11px; color: #999; }
.purchase-quantity {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}
.purchase-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 12px;
}
.purchase-empty-icon {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Tab导航样式 */
.nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}
.nav-list .tab-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 500;
}
.nav-list .tab-link:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.nav-list .tab-link.active {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.tab-content { margin-top: 20px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 售罄标签 */
.ribbon-two {
    position: absolute;
    top: 10px;
    right: -5px;
    z-index: 15;
}
.ribbon-two span {
    position: relative;
    display: block;
    padding: 5px 15px;
    background: #dc3545;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ribbon-two span:before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    border-style: solid;
    border-width: 0 5px 5px 0;
    border-color: transparent #a71e2a transparent transparent;
}

/* 通知区域 */
.notice { line-height: 1.6; color: var(--text-gray); }

/* 文章板块样式 */
.articles-section {
    margin: 30px 0;
    padding: 0;
    width: 100%;
}
.articles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.articles-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}
.articles-more {
    font-size: 14px;
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
}
.articles-more:hover {
    color: #ff468b;
    transform: translateY(-2px);
}
.article-card {
    cursor: pointer;
    box-shadow: 3px 3px 5px 0px rgba(0,0,0,0.15);
    border: 2px solid #fff;
    background: linear-gradient(#f3f5f9, #ffffff);
    border-radius: 5px;
    transition: var(--transition);
}
.article-card:hover { box-shadow: var(--hover-shadow); }
.article-thumbnail-wrapper {
    height: 120px;
    border-radius: 0.85rem;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #c9c9c9;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
}
.article-thumbnail { transition: all 0.3s ease; }
.article-card:hover .article-thumbnail { transform: scale(1.05); }
.article-content { padding: 12px; }
.article-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: usaxhj, pingfang SC, helvetica neue, arial, hiragino sans gb, microsoft yahei ui, microsoft yahei, simsun, sans-serif;
}
.article-excerpt {
    font-size: 12px;
    color: #838383;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-meta { font-size: 11px; color: #999; }
.article-link {
    text-decoration: none;
    display: block;
    height: 100%;
    color: inherit;
}

/* 响应式样式（合并重复媒体查询） */
@media screen and (max-width: 769px) {
    .hyper-wrapper { padding: 0; display: block; }
    .home-card {
        padding: 12px;
        margin-bottom: 18px;
        font-size: 14px;
        display: flex;
        align-items: flex-start;
    }
    .home-img {
        max-width: 80px;
        min-width: 80px;
        height: 80px;
        margin-right: 12px;
        border-radius: 0.85rem;
        border: 1px solid #c9c9c9;
        box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
    }
    .corner-mark { font-size: 9px; padding: 1px 6px; }
    .name {
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: left;
        font-family: usaxhj, pingfang SC, helvetica neue, arial, hiragino sans gb, microsoft yahei ui, microsoft yahei, simsun, sans-serif;
        color: var(--text-color);
    }
    .price { color: #ff468b; vertical-align: text-top; }
    .price b { font-size: 16px; }
    .dibu { position: absolute; left: 105px; bottom: 12px; }
    .zdong, .sdong, .kucun, .xiaoliang {
        border: 1px solid;
        font-size: 12px;
        text-align: center;
        padding: 1px 6px;
        border-radius: 3px;
        display: inline-block;
        margin: 0 3px 0 0;
    }
    .zdong { border-color: #18bc9c; color: #18bc9c; }
    .sdong { border-color: #ff8600; color: #ff8600; }
    .kucun { border-color: #b636d5; color: #b636d5; }
    .xiaoliang { border-color: #4CAF50; color: #4CAF50; }
    .article-card { padding: 12px; margin-bottom: 18px; }
    .choose-us-list { gap: 15px; }
    .choose-us-card { min-width: 100%; max-width: 100%; margin-bottom: 10px; }
    .articles-container { display: block; padding: 0; }
    /* 角标位置 */
    .corner-mark:nth-of-type(1) { top: 6px; left: 6px; }
    .corner-mark:nth-of-type(2) { top: 6px; left: 45px; }
    .corner-mark:nth-of-type(3) { top: 28px; left: 6px; }
    .corner-mark:nth-of-type(4) { top: 28px; left: 45px; }
}

@media screen and (min-width: 769px) {
    .hyper-wrapper {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0;
    }
    .home-card {
        padding: 12px;
        font-size: 14px;
        display: flex;
        flex-direction: column;
        border-radius: 8px;
        box-shadow: 3px 3px 5px 0px rgba(0,0,0,0.15);
    }
    .home-img {
        width: 100px;
        height: 100px;
        border-radius: 18px;
        border: 1px solid #c9c9c9;
        box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    }
    .name {
        font-size: 15px;
        min-height: 42px;
        margin: -100px 0 0 125px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-family: usaxhj, pingfang SC, helvetica neue, arial, hiragino sans gb, microsoft yahei ui, microsoft yahei, simsun, sans-serif;
        color: var(--text-color);
    }
    .price { color: #ff468b; vertical-align: middle; }
    .price b { font-size: 18px; }
    .dibu { position: absolute; left: 132px; bottom: 11px; }
    .mshu1 { margin-left: 120px; font-size: 12px; color: #838383; }
    .zdong, .sdong, .kucun, .xiaoliang {
        border: 1px solid;
        font-size: 12px;
        padding: 2px 6px;
        border-radius: 3px;
        display: inline-block;
        margin: 0 5px 0 3px;
    }
    .zdong { border-color: #18bc9c; color: #18bc9c; }
    .sdong { border-color: #ff8600; color: #ff8600; }
    .kucun { border-color: #b636d5; color: #b636d5; }
    .xiaoliang { border-color: #4CAF50; color: #4CAF50; }
    .articles-container {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        padding: 0;
    }
    .choose-us-list { gap: 15px; }
    /* 角标位置 */
    .corner-mark:nth-of-type(1) { top: 8px; left: 8px; }
    .corner-mark:nth-of-type(2) { top: 8px; left: 60px; }
    .corner-mark:nth-of-type(3) { top: 35px; left: 8px; }
    .corner-mark:nth-of-type(4) { top: 35px; left: 60px; }
}

/* 大屏适配 */
@media screen and (min-width: 951px) {
    .hyper-wrapper { gap: 20px; }
    .articles-container { gap: 20px; }
    .article-thumbnail-wrapper { height: 140px; }
}

/* CSS变量回退，兼容IE浏览器 */
.home-card:hover {
    box-shadow: 0px 0px 5px 0 #F44336;
    box-shadow: 0px 0px 5px 0 var(--primary-color);
}
.choose-us-card:hover .choose-us-card-title {
    color: #007bff;
    color: var(--secondary-color);
}
/* 禁止整个网站的文字选择和拖拽 */
body {
    -webkit-user-select: none; /* Chrome/Safari/Edge */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+ */
    user-select: none;         /* 标准语法 */
    -webkit-touch-callout: none; /* iOS Safari */
}

/* 允许特定区域可以选中（比如输入框） */
input, textarea, .allow-select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
