/**
 * 自定义样式文件
 * 自媒体网
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    
    /* 后台暖色主题 */
    --admin-nav-bg: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
    --admin-nav-hover: linear-gradient(135deg, #ff8787 0%, #ffc078 100%);
    --admin-nav-active: linear-gradient(135deg, #ff8787 0%, #ffc078 100%);
    --admin-nav-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f6f7f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部蓝色 Banner */
.site-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #486df1 0%, #8fa4f8 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Banner 标题链接样式 */
.banner-title-link {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.banner-title-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.banner-title {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
}

.banner-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.banner-right .btn {
    padding: 0.4rem 1rem;
    font-size: 1.1rem;
    white-space: nowrap;
    font-weight: 500;
    background: transparent !important;
    border: none !important;
    color: white !important;
}

.banner-right .btn:hover {
    opacity: 0.8;
}

/* 页脚样式 */
.site-footer {
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 1rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

/* 手机版底部固定导航栏 */
.mobile-bottom-nav {
    display: none;  /* 默认隐藏，仅手机版显示 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;  /* 确保占满整个屏幕宽度 */
    height: 55px;
    background-color: #ffffff;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
    z-index: 1000;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.mobile-bottom-nav .nav-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333333;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 0;
    transition: all 0.2s ease;
    flex: 1 !important;
    text-align: center;
}

.mobile-bottom-nav .nav-item:hover {
    color: #0d6efd;
}

.mobile-bottom-nav .nav-item.active {
    color: #0d6efd;
    font-weight: 700;
}

/* 响应式：手机版显示底部导航 */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;  /* 手机版显示 */
        width: 100vw !important;  /* 使用视口宽度 */
        left: 0 !important;
        right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* 为底部导航留出空间，防止内容被遮挡 */
    body {
        padding-bottom: 55px;
    }
    
    /* 主内容区底部也要留出空间 */
    .main-content {
        padding-bottom: 55px !important;
    }
}

/* 首页联系方式卡片样式 */
.contact-item {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.contact-item i {
    transition: all 0.3s ease;
}

.contact-item:hover i {
    transform: scale(1.2);
}

/* 响应式：手机版联系方式 */
@media (max-width: 768px) {
    .contact-item {
        padding: 1rem !important;
    }
    
    .contact-item i {
        font-size: 2rem !important;
    }
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
}

.footer-content a {
    color: #0d6efd;
    text-decoration: none;
}

.footer-content a:hover {
    color: #0a58ca;
}

/* 订单列表样式 - 长条形卡片布局 */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 搜索栏 */
.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-input-wrap {
    flex: 1;
    min-width: 0;
}

.search-input-wrap .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    width: 100%;
}

.search-input-wrap .form-control:focus {
    border-color: #6f42c1;
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.15);
}

.search-btn-wrap {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    /* 2026-11-12：搜索框与「搜索」按钮排在同一行，省掉一整行高度。
       原来是 flex-wrap:wrap + 两个子项 width:100%，输入框一行、按钮另起一行。 */
    .search-form {
        flex-wrap: nowrap;
        gap: 0.4rem;
    }
    .search-input-wrap {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }
    .search-btn-wrap {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-end;
    }
    /* 两个按钮同时出现（带「清除」）时也别把输入框挤没 */
    .search-btn-wrap .btn {
        flex: 0 0 auto;
    }
}

.order-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.order-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.order-status .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.order-time {
    font-size: 0.85rem;
    color: #6c757d;
}

.order-body {
    padding: 1rem;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.order-no {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.order-no i {
    margin-right: 0.5rem;
    color: #6c757d;
}

.order-product {
    font-size: 0.95rem;
    color: #212529;
    font-weight: 600;
    line-height: 1.5;
}

.order-product i {
    margin-right: 0.5rem;
    color: #0d6efd;
}

.order-price-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-unit-price,
.order-quantity {
    font-size: 0.85rem;
    color: #6c757d;
}

.order-unit-price i,
.order-quantity i {
    margin-right: 0.3rem;
}

.order-amount {
    font-size: 1.1rem;
    margin-top: 0.3rem;
}

.order-amount i {
    margin-right: 0.5rem;
    color: #dc3545;
}

.order-footer {
    padding: 0.8rem 1rem;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.order-footer .btn {
    min-width: 120px;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .orders-list {
        gap: 0.8rem;
    }
    
    .order-card {
        border-radius: 8px;
    }
    
    .order-header {
        padding: 0.6rem 0.8rem;
    }
    
    .order-body {
        padding: 0.8rem;
    }
    
    /* 订单底部按钮：两个并排各占一半（2026-11-12）
       原来是 width:100% 各占一整行，「订单详情」+「查看授权码」两张卡就吃掉 80px，
       手机上一屏看不了两条订单。改成 flex 一行两列，居中排列。 */
    .order-footer {
        padding: 0.45rem 0.8rem;
        display: flex;
        gap: 0.5rem;
        justify-content: center;   /* flex 下 text-align 失效，单按钮靠它居中 */
        text-align: center;
    }

    .order-footer .btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;          /* 桌面端的 min-width:120px 必须清掉，否则两个按钮加起来超宽 */
        /* 36~38px 比全局触摸区的 44px 矮一档：一行照样好点，又不至于把卡片撑高。
           min-height 用自身权重就能压住 mobile-compact 的 `a,button,.btn{min-height:44px}`。 */
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        /* ⚠️ 字号/内边距必须 !important：mobile-compact.css 在 style.css 之后加载，
           且写了 `.btn-sm{font-size:.8rem!important;padding:.35rem .6rem!important}`；
           不加就压不住，按钮会变回 .8rem + 宽内边距。 */
        /* 字号用 vw 自适应：393 屏 ≈13.7px、360 ≈12.6px、320 ≈11.2px。
           固定 rem 的话，320/360 下「查看授权码（1）」会顶到按钮边缘甚至溢出。 */
        padding: 0.25rem min(0.5rem, 1.2vw) !important;
        font-size: min(0.88rem, 3.5vw) !important;
        line-height: 1.25;
        white-space: nowrap;
    }

    .order-footer .btn i {
        display: none;
    }

    /* 只有一个按钮时（订单里没有授权码）不占满整行，居中显示半行宽。
       用 flex-basis 而不是 min-width：min-width 的百分比在这个 flex 行里算出来偏小，
       实测按钮只有 121px，中心比容器中心左偏 13px。 */
    .order-footer .btn:only-child {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* 320px 窄屏：「查看授权码（1）」7 个全角字在 91px 里还是放不下，字号再降一档 */
/* 窄屏字号已由上面 .order-footer .btn 的 min(0.88rem,3.5vw) 自动处理，无需单独媒体查询 */

/* 个人中心最近订单卡片样式 */
.recent-orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.8rem;
}

.recent-order-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.8rem;
    transition: all 0.3s ease;
}

.recent-order-item:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.order-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.order-status .badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

.order-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.order-middle {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.order-product-name {
    flex: 1;
    font-size: 0.9rem;
    color: #212529;
    font-weight: 600;
    line-height: 1.4;
}

.order-product-name i {
    margin-right: 0.5rem;
    color: #0d6efd;
}

.order-price-qty {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.order-price-qty .price {
    font-size: 1.1rem;
    color: #dc3545;
    font-weight: 700;
}

.order-price-qty .qty {
    font-size: 0.8rem;
    color: #6c757d;
}

.order-bottom {
    text-align: right;
    padding-top: 0.6rem;
    border-top: 1px solid #f0f0f0;
}

.order-bottom .btn {
    min-width: 110px;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .recent-orders-list {
        gap: 0.6rem;
        padding: 0.6rem;
    }
    
    .recent-order-item {
        padding: 0.6rem;
    }
    
    .order-middle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .order-price-qty {
        align-items: flex-start;
    }
    
    .order-bottom .btn {
        width: 100%;
    }
}

/* 平台公告样式 */
.container:first-child {
    padding-top: 0;  /* 第一个 container 移除顶部 padding */
    margin-top: 0;  /* 移除顶部外边距，让内容更紧凑 */
}

/* 移除所有容器的白色背景 */
.container {
    background-color: transparent !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left: 5px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;  /* 添加顶部 margin，与 Banner 分开 */
    position: sticky;  /* 固定定位 */
    top: 70px;  /* 固定在 Banner 下方 */
    z-index: 999;  /* 确保在内容上方 */
}

.alert-warning .alert-heading {
    color: #856404;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.alert-warning ol {
    padding-left: 1.3rem;
    margin-bottom: 0;
}

.alert-warning li {
    color: #856404;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* 欢迎内容样式 */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none;
}

.card-body {
    padding: 1.2rem;
}

.card-title {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #2c5282;
}

.list-unstyled li {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.list-unstyled li i {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

/* 移动端公告和欢迎内容调整 */
@media (max-width: 768px) {
    .alert-warning {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
    
    .alert-warning .alert-heading {
        font-size: 0.95rem;
    }
    
    .alert-warning li {
        font-size: 0.8rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .list-unstyled li {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* ===== 横向长条商品卡片样式 ===== */
.product-list-horizontal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-card-horizontal {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #e9ecef;
}

.product-card-horizontal:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.product-card-middle {
    flex: 1;
    min-width: 0;
    margin-right: 1rem;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 注：.product-meta（分类标签容器）已随标签移除而废弃，规则已清理。
   若将来要恢复分类标签，需同时恢复 products/category.php 中的
   <div class="product-meta"><span class="badge bg-info">...</span></div>。 */

.product-card-right {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.product-price-section {
    text-align: right;
}

/* 价格颜色：与移动端 @media 内规则保持一致（#dc3545），
   不要改回 var(--primary-color)，否则桌面端会显示为蓝色。 */
.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #dc3545;
    line-height: 1.2;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

/* 手机版优化 */
@media (max-width: 768px) {
    /* 两行紧凑布局：
       第1 行 = [分类标签] + [商品标题]（同行，标题单行省略）
       第 2 行 = [价格]              + [查看详情按钮]（左右分布）
       整卡纵向堆叠，不再是左右两列 */
    .product-card-horizontal {
        flex-direction: column;
        align-items: stretch;
        padding: 0.65rem 0.75rem;
        gap: 0.45rem;
    }

    /* 第一行容器：标题区占满整行 */
    .product-card-middle {
        flex: 0 0 auto;
        min-width: 0;
        margin-right: 0;
        margin-bottom: 0;
    }

    /* 标题区内部：标签与标题横向同行 */
    .product-info {
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
    }

    /* 注：.product-meta 相关移动端规则已随分类标签移除而清理 */
    /* 标题占满剩余宽度，单行超出省略 */
    .product-title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.9rem;
        font-weight: 600;
        color: #212529;
        margin: 0;
        line-height: 1.35;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 第二行容器：价格 + 按钮左右分布 */
    .product-card-right {
        flex: 0 0 auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
        margin-left: 0;
    }

    .product-price-section {
        text-align: left;
        flex: 0 0 auto;
    }

    /* 价格是手机上最关心的信息，红色加粗突出 */
    .product-price {
        font-size: 1.15rem;
        font-weight: 700;
        color: #dc3545;
        line-height: 1.2;
        white-space: nowrap;
    }

    /* 按钮靠右。2026-11-07：
       ① 高度：原来靠 padding 撑到 38px，再被 mobile-compact.css 的全局
          a/button{min-height:44px} 顶成 44px，在窄卡片里像个蓝方块；
       ② 居中：后面还有 .btn / .product-card .btn 两条规则会覆盖本段
          （媒体查询不提升优先级，谁在后面谁赢），所以这里提高特异性并
          用 flex 居中，不靠 line-height 算，避免文字偏下。
          实测旧版 gapTop 11.6 / gapBottom 1.4，文字明显下沉。 */
    .product-card-horizontal .product-card-right .product-detail-btn,
    .product-card-horizontal .product-card-right .btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 30px !important;
        min-height: 30px !important;
        min-width: 0 !important;
        padding: 0 0.7rem !important;
        font-size: 0.78rem !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        flex: 0 0 auto;
        border-radius: 7px !important;
    }

    /* 卡片之间间距收紧 */
    .product-list-horizontal {
        gap: 0.5rem;
    }
}

main {
    flex: 1;
}

/* 导航栏样式优化 */
.navbar-brand {
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* 导航栏滚动优化 */
@media (max-width: 991px) {
    .navbar-collapse {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .navbar-nav {
        flex-wrap: nowrap;
    }
    
    .navbar-nav .nav-item {
        flex-shrink: 0;
    }
}

/* 顶部工具栏 */
.bg-dark {
    background-color: #212529 !important;
}

/* 二级导航栏样式 */
.nav-pills .nav-link {
    color: #495057;
    background-color: transparent;
    border-radius: 5px;
    padding: 0.4rem 0.8rem;
    margin-right: 0.3rem;
    font-size: 0.9rem;
}

.nav-pills .nav-link:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

/* 下拉菜单样式优化 */
.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.6rem 1.2rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1.2rem;
}

/* 商品卡片 */
.product-card {
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.product-card .card-body {
    padding: 1rem;
}

/* 纵向卡片（.product-card）的价格样式。
   注意：横向长条卡片用的是 .product-card-horizontal，
   它的价格字号/颜色由前面的 @media(max-width:768px) 规则控制，
   这里的通用规则放在后面会覆盖移动端设置，所以必须限定 .product-card 作用域。 */
.product-card .product-price {
    font-size: 1.25rem;
    color: #dc3545;
    font-weight: bold;
}

.product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* 用户等级徽章 */
.level-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* 个人中心等级徽章 - 手机版放大 */
@media (max-width: 768px) {
    .profile-card .level-badge {
        font-size: 1.3rem;
        padding: 0.6rem 1.2rem;
        border-radius: 10px;
        font-weight: 700;
        display: inline-block;
        min-width: 140px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    /* 各级用户配色优化 - 更鲜艳醒目 */
    .profile-card .level-0 {
        background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
        color: #ffffff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    .profile-card .level-1 {
        background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
        color: #ffffff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    .profile-card .level-2 {
        background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
        color: #000000;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    }
    
    .profile-card .level-3 {
        background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
        color: #ffffff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}

/* 商品分类标签优化 */
.product-card .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
}

/* 商品标题优化 */
.product-card .card-title {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 价格区域优化 */
.product-card .mb-3 {
    margin-bottom: 0.75rem !important;
}

/* 按钮优化 */
.product-card .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* 二级分类快速导航样式 */
.sub-category-nav {
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sub-category-nav .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.sub-category-nav .btn-sm.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 减小商品卡片之间的间距 - 桌面端 */
.row .col-md-6,
.row .col-lg-3 {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    margin-bottom: 0.5rem !important;  /* 8px 上下间隔 */
}

.level-0 { background-color: #6c757d; color: white; }
.level-1 { background-color: #17a2b8; color: white; }
.level-2 { background-color: #ffc107; color: #000; }
.level-3 { background-color: #fd7e14; color: white; }

/* 首页用户信息卡片 */
.user-info-card {
    background: linear-gradient(135deg, #486df1 0%, #3355d8 100%);
    border-radius: 15px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(72,109,241, 0.3);
}

.user-info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info-content {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: white;
}

.user-level {
    font-size: 0.9rem;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.user-actions .btn {
    white-space: nowrap;
}

/* 响应式：手机版优化 */
@media (max-width: 768px) {
    .user-info-card {
        padding: 1.25rem;
    }
    
    .user-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .user-name {
        font-size: 1.1rem;
    }
    
    .user-actions {
        width: 100%;
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .user-actions .btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* 个人中心 */
.profile-card {
    background: linear-gradient(135deg, #486df1 0%, #3355d8 100%);
    color: white;
    border-radius: 15px;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
}

/* 头像样式已移除 - 简化个人中心设计 */

/* 联系方式长条布局 */
.contact-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-item strong {
    color: #333;
    white-space: nowrap;
}

.contact-item a,
.contact-item span {
    white-space: nowrap;
}

.contact-divider {
    width: 1px;
    height: 30px;
    background: #dee2e6;
}

/* 响应式：移动端垂直排列 */
@media (max-width: 768px) {
    .contact-bar {
        flex-direction: column;
        gap: 0.75rem !important;
        padding: 0.75rem;
        background: transparent;
        box-shadow: none;
    }
    
    .contact-divider {
        display: none;
    }
    
    .contact-item {
        width: 100%;
        background: white;
        padding: 0.75rem 1rem;
        border-radius: 6px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
}

/* 统计卡片 */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 表格样式 */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #486df1 0%, #3355d8 100%);
    color: white;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: #486df1;
    box-shadow: 0 0 0 0.2rem rgba(72,109,241, 0.25);
}

/* 面包屑导航 */
.breadcrumb {
    background-color: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

/* 页脚样式 */
footer a:hover {
    color: #fff !important;
    text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* 纵向卡片价格字号。横向长条卡片（.product-card-horizontal）的价格字号
       由前面的 @media 规则控制，这里必须限定 .product-card 才不会覆盖它 */
    .product-card .product-price {
        font-size: 1.1rem;
    }
    
    .profile-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* 移动端商品卡片更紧凑 */
    .product-card .card-body {
        padding: 0.75rem;
    }
    
    .product-card .card-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .product-card .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .product-card .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* 移动端商品卡片之间间距 */
    .row .col-md-6,
    .row .col-lg-3 {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
        margin-bottom: 0.5rem !important;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 价格展示 */
.price-level-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin: 0.2rem;
    font-size: 0.85rem;
}

/* ========== 后台管理系统 - 暖色导航 ========== */

/* 导航栏整体样式 */
.admin-navbar {
    background: var(--admin-nav-bg) !important;
    box-shadow: var(--admin-nav-shadow);
    padding: 0.8rem 1.5rem;
    transition: all 0.3s ease;
}

/* 强制导航容器水平布局 */
.admin-navbar .navbar-collapse {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100%;
}

/* 强制导航项水平排列 */
.admin-navbar .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.5rem;
}

.admin-navbar .navbar-nav.me-auto {
    flex-grow: 1 !important;
}

.admin-navbar .navbar-nav .nav-item {
    display: inline-block !important;
    float: none !important;
}

/* 品牌 Logo 区域 */
.admin-navbar .navbar-brand {
    color: white !important;
    font-weight: 700;
    font-size: 1.3rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff5252 0%, #ff9800 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-navbar .navbar-brand:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
    border-color: rgba(255, 255, 255, 0.9);
}

.admin-navbar .navbar-brand i {
    margin-right: 0.5rem;
    font-size: 1.4rem;
}

/* 导航项样式 */
.admin-navbar .nav-link {
    color: white !important;
    font-weight: 600;
    padding: 0.7rem 1.3rem;
    margin: 0 0.3rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.admin-navbar .nav-link:hover {
    color: white !important;
    background: linear-gradient(135deg, #ff8787 0%, #ffc078 100%);
}

.admin-navbar .nav-link.active {
    color: white !important;
    background: linear-gradient(135deg, #ff5252 0%, #ff9800 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.9);
}

.admin-navbar .nav-link i {
    margin-right: 0.4rem;
    font-size: 1.2rem;
    filter: brightness(1.2);
}

/* 用户下拉菜单 */
.admin-navbar .navbar-nav .nav-link.dropdown-toggle {
    background: linear-gradient(135deg, #ff5252 0%, #ff9800 100%);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.admin-navbar .navbar-nav .nav-link.dropdown-toggle:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
    border-color: rgba(255, 255, 255, 0.9);
}

/* 下拉菜单项 */
.admin-navbar .dropdown-menu {
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0;
}

.admin-navbar .dropdown-item {
    color: #333;
    padding: 0.6rem 1.2rem;
}

.admin-navbar .dropdown-item:hover {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe0e0 100%);
    color: #ff6b6b;
}

.admin-navbar .dropdown-item i {
    margin-right: 0.5rem;
}

.admin-navbar .dropdown-divider {
    border-top-color: rgba(255, 107, 107, 0.2);
}

/* 移动端折叠菜单按钮 */
.admin-navbar .navbar-toggler {
    border: none;
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.admin-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.admin-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 移动端响应式 */
@media (max-width: 991px) {
    .admin-navbar .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 8px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    }
    
    .admin-navbar .nav-link {
        color: #333 !important;
        background: transparent;
        margin: 0.3rem 0;
        border: none;
    }
    
    .admin-navbar .nav-link:hover,
    .admin-navbar .nav-link.active {
        background: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
        color: white !important;
    }
    
    .admin-navbar .nav-link i {
        filter: none;
    }
}

.price-level-1 { background-color: #d1ecf1; color: #0c5460; }
.price-level-2 { background-color: #fff3cd; color: #856404; }
.price-level-3 { background-color: #ffe5d0; color: #fd7e14; }
.price-original { background-color: #f8f9fa; color: #6c757d; }

/* 充值页面支付选项卡片样式 */
.payment-option-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.payment-option-card:hover {
    border-color: #1677FF;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.2);
    transform: translateY(-2px);
}

.payment-option-card input[type="radio"]:checked + .form-check-label .payment-option-content {
    color: #1677FF;
}

.payment-option-card input[type="radio"]:checked + .form-check-label {
    border-color: #1677FF;
}

.payment-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.payment-option-card .bi {
}

/* 充值凭证页面二维码样式 */
.qr-code-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========== 会员中心专属样式 ==========
   约定：membership.php 不再使用内联样式，所有视觉细节集中在这里。
   页面容器是 .membership-page（不是 .main-content —— 那个已由 header.php 输出）。 */

/* 页面底色 + 最小高度。
   注意：顶部的 55px 避让由 .main-content 的 padding-top 承担，
   .main-content 是本页的父级，所以这里不能用 min-height:100vh，
   否则会与父级的 padding-top 叠加出一条多余滚动条。 */
.membership-page {
    min-height: calc(100vh - 55px);
    background: #f6f7f9;
    padding-bottom: 1rem;
}

/* 内容列：限制最大宽度，超宽屏不拉伸。
   注意：不要在这里写 padding-left/right —— style.css 与 mobile-compact.css 里
   .container 都被 `padding: 0.5rem !important` 锁死了，写了也会被压掉。 */
.membership-container {
    max-width: 720px;
}

/* --- 顶部用户信息卡 --- */
.membership-card {
    background: linear-gradient(135deg, #486df1 0%, #3355d8 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.membership-username {
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.3;
    word-break: break-all;
}

.membership-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #fff;
}

.membership-badge .bi-star-fill,
.membership-badge .bi-crown-fill {
    color: #ffd700;
}

.membership-badge .bi-star-half {
    color: #d8d8d8;
}

/* 余额：最多 8 位数字 + 千分位，用 clamp 保证不撑破卡片 */
.membership-balance {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.membership-balance-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* --- 充值入口 --- */
.membership-recharge {
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
    margin-bottom: 0.75rem;
}

.membership-recharge-btn {
    padding: 0.75rem 1rem;
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0958d9;
    text-decoration: none;
}

.membership-recharge-tip {
    color: rgba(255, 255, 255, 0.85);
}

/* --- 通用白底面板（账户管理） --- */
.membership-panel {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.membership-panel-head {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.75rem 1rem;
}

.membership-panel-head h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.membership-panel-head .bi {
    color: #6f42c1;
}

.membership-action {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

/* --- 数据统计小卡 --- */
.membership-stat {
    border-radius: 8px;
    overflow: hidden;
}

.membership-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.membership-stat-value.is-money  { color: #0d6efd; }
.membership-stat-value.is-cyan   { color: #17a2b8; }
.membership-stat-value.is-amber  { color: #ffc107; }
.membership-stat-value.is-green  { color: #20c997; }

.membership-stat-label {
    font-size: 0.75rem;
    color: #6c757d;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .membership-username    { font-size: 1.1rem; }
    .membership-balance     { font-size: 1.25rem; }
    .membership-stat-value  { font-size: 1.1rem; }
}

/* 超窄屏（<380px）：余额与用户名改为上下排列，避免挤在一行换行难看 */
@media (max-width: 380px) {
    .membership-card .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    .membership-card .text-end {
        text-align: left;
    }
}

/* --- 覆盖 mobile-compact.css 的 !important ---
   mobile-compact.css 是全站最后加载的 CSS，且对 .btn / .card-body / .card 用了
   `!important`，本页的样式权重比不过它。只能在这里同样用 !important 反压。
   以后若清理 mobile-compact.css 里的这些 !important，本段即可整段删除。 */
.membership-page .card-body.membership-body { padding: 1rem; }
.membership-page .card-body.membership-body-tight { padding: 0.5rem; }
.membership-page .btn.membership-recharge-btn {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 700;
}
.membership-page .btn.membership-action {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
}
.membership-page .card.membership-stat,
.membership-page .card.membership-panel,
.membership-page .card.membership-recharge,
.membership-page .card.membership-card {
    border-radius: 12px;
}
.membership-page .card.membership-stat { margin-bottom: 0; }

.qr-code-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ========== 返回主站（四站统一入口，橙色高对比） ========== */
.back-home{
    display:inline-flex;align-items:center;gap:5px;flex:none;
    height:30px;min-height:30px;padding:0 11px;border-radius:7px;
    background:linear-gradient(135deg,#ff8a3d 0%,#ff5722 100%);
    color:#fff!important;font-size:13px;font-weight:600;line-height:1;
    text-decoration:none!important;white-space:nowrap;
    box-shadow:0 1px 4px rgba(255,87,34,.3);
    transition:transform .15s ease,box-shadow .15s ease,filter .15s ease;
}
.back-home:hover{box-shadow:0 3px 10px rgba(255,87,34,.4);filter:brightness(1.04)}
/* 放在右侧「个人中心」旁边时，和按钮组同高，避免一高一矮 */
.banner-right .back-home{height:31px;min-height:31px;font-size:14px;padding:0 12px;gap:5px;border-radius:7px}
.banner-right .back-home svg{width:13px;height:13px}
.back-home:active{transform:scale(.97)}
.back-home svg{width:13px;height:13px;flex:none}
@media (max-width:480px){
    .back-home, .banner-right .back-home{height:24px;min-height:24px;padding:0 8px;font-size:11.5px;gap:3px;border-radius:6px}
    .banner-right .back-home{font-weight:600}
    .back-home svg{width:11px;height:11px}
}

/* 底部导航「充值」固定红色（2026-11-09）
   充值入口要显眼，覆盖 .nav-item 的 #333 和 .active 的蓝色，任何页面都保持红色 */
.mobile-bottom-nav .nav-item.nav-item-recharge,
.mobile-bottom-nav .nav-item.nav-item-recharge:hover,
.mobile-bottom-nav .nav-item.nav-item-recharge.active{
    color: #dc2626;
}
