/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    padding-top: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 整体内容宽度固定为 1600px，并居中 */
.main-content {
    flex: 1;
    width: 1600px;
    max-width: 100%;
    padding: 20px 15px;
    margin-bottom: 20px; /* 减小底部边距 */
}

/* 导航栏 */
.navbar-brand {
    font-weight: bold;
    font-size: 20px;
}

.navbar-nav {
    float: right;
}

/* 导航链接样式优化 */
.navbar-nav > li > a {
    cursor: pointer;
    margin: 8px 5px; /* 增加间距 */
    padding: 7px 15px !important; /* 调整内边距 */
    border-radius: 20px; /* 圆角效果 */
    transition: all 0.3s;
    color: #555;
    font-weight: 500;
}

.navbar-nav > li > a:hover {
    background-color: #e9ecef !important;
    color: #337ab7 !important;
}

/* 导航栏选中状态 - 明显样式 */
.navbar-default .navbar-nav > .active > a, 
.navbar-default .navbar-nav > .active > a:hover, 
.navbar-default .navbar-nav > .active > a:focus {
    color: #fff !important;
    background: linear-gradient(135deg, #007bff 0%, #0062cc 100%) !important;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* 导航栏用户信息样式 */
.navbar-user-info > a {
    display: flex !important;
    align-items: center;
    gap: 15px;
    padding: 7px 15px !important;
    background: transparent !important; /* 用户信息不应用选中背景 */
}

/* 覆盖 .active 对用户信息的误伤（如果有） */
.navbar-nav > li.navbar-user-info.active > a {
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
}

.navbar-balance {
    color: #5cb85c;
    font-weight: 500;
}

.navbar-balance i {
    margin-right: 5px;
}

.navbar-balance strong {
    font-size: 16px;
    color: #f0ad4e;
}

.navbar-refresh-btn {
    margin-left: 5px;
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.3s;
}

.navbar-refresh-btn:hover {
    background-color: #337ab7;
    border-color: #337ab7;
    color: #fff;
}

.navbar-refresh-btn i {
    font-size: 12px;
}

/* 用户名下拉菜单样式 */
.navbar-nav > li.dropdown > a {
    font-weight: 500;
}

/* 用户下拉菜单 Hover 显示 */
.navbar-nav > li.dropdown:hover > .dropdown-menu {
    display: block;
    margin-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border: none;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.navbar-nav > li.dropdown > a i.glyphicon-user {
    color: #337ab7;
    margin-right: 5px;
}

.navbar-nav .dropdown-menu li a i {
    margin-right: 8px;
    width: 14px;
    text-align: center;
}

.navbar-nav .dropdown-menu li a:hover {
    background-color: #f5f5f5;
}

/* 刷新按钮旋转动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.glyphicon-spin {
    animation: spin 1s linear infinite;
}

/* 页脚 */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 60px;
    background-color: #f5f5f5;
    border-top: 1px solid #e7e7e7;
    padding: 20px 0;
    text-align: center;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

/* 商品列表 */
.goods-filters {
    margin-bottom: 10px;
}

.card-goods-types {
    border-left: none; /* 移除左侧蓝条，整体更简洁 */
    padding: 15px; /* 减小内边距 */
}

.card-goods-types .card-header {
    display: none; /* 隐藏原本的"商品分类"标题，节省空间 */
}

/* 一级分类按钮组（更醒目，支持logo） */
.type-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 5px;
}

/* 使用 !important 强制覆盖可能存在的其他样式干扰 */
.type-filter-item {
    display: inline-flex !important;
    align-items: center !important;
    padding: 12px 28px !important; /* 增大按钮 */
    border-radius: 12px !important; /* 圆角稍微改小一点，更有现代感 */
    border: 2px solid #eee !important;
    background: #f8f9fa !important;
    font-weight: 600 !important;
    font-size: 16px !important; /* 增大字体 */
    color: #555 !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
    cursor: pointer !important;
    user-select: none !important;
}

.type-filter-item .type-filter-logo {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 12px !important;
}

.type-filter-item .type-filter-logo img {
    width: 36px !important; /* 增大 Logo */
    height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    background: transparent;
}

.type-filter-item .type-filter-title {
    white-space: nowrap !important;
}

.type-filter-item:hover {
    border-color: #b8daff !important;
    background: #fff !important;
    color: #007bff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(0,123,255,0.15) !important;
}

.type-filter-item.active {
    border-color: transparent !important;
    background: linear-gradient(135deg, #007bff 0%, #0062cc 100%) !important; /* 蓝色渐变 */
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(0,123,255,0.3) !important; /* 强阴影 */
    transform: translateY(-2px) scale(1.02) !important; /* 选中时稍微放大 */
}

.type-filter-item.active .type-filter-logo img {
    background: #fff !important; /* 选中时给logo加个白底 */
    padding: 2px !important;
}

.label-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee; /* 加个虚线分隔 */
}

.label-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.label-filter-btn:hover {
    background: #e2e6ea;
    color: #333;
    transform: translateY(-1px);
}

.label-filter-btn.active {
    background: #e7f1ff; /* 浅蓝色背景 */
    color: #007bff; /* 蓝色文字 */
    border-color: #007bff;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,123,255,0.15);
}

.label-filter-btn img {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    border-radius: 50%;
}

.goods-list {
    display: grid;
    /* 固定 6 列布局，不随屏幕变宽而增加列数 */
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-top: 20px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.goods-list.loading {
    opacity: 0.3;
    pointer-events: none;
}

.goods-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    /* 固定卡片高度，宽度由 6 列栅格决定 */
    min-height: 260px;
    user-select: none;
}

.goods-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.goods-item * {
    cursor: pointer;
    pointer-events: none;
}

.goods-item-image-wrapper {
    position: relative;
}

.goods-item-image-wrapper img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.goods-item-id {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.goods-item-body {
    padding: 15px;
}

.goods-item-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.goods-item-price {
    color: #ff4757;
    font-size: 20px;
    font-weight: bold;
}

.goods-item-info {
    color: #666;
    font-size: 12px;
    margin-top: 8px;
}

/* 商品详情 */
.goods-detail-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.goods-detail-image {
    flex-shrink: 0;
}

.goods-detail-image img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.goods-detail-info {
    flex: 1;
}

.goods-detail-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.goods-detail-id {
    color: #999;
    font-size: 14px;
    font-weight: normal;
    margin-right: 8px;
}

.goods-detail-price {
    font-size: 28px;
    color: #ff4757;
    font-weight: bold;
    margin-bottom: 10px;
}

.goods-detail-specs {
    color: #666;
    line-height: 1.8;
}

/* 订单表单 */
.order-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.form-group label {
    font-weight: bold;
}

.order-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.order-mode-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.order-mode-tab:hover {
    border-color: #007bff;
}

.order-mode-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.order-summary {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.order-summary h4 {
    margin-bottom: 10px;
}

.order-summary .total-price {
    font-size: 24px;
    color: #ff4757;
    font-weight: bold;
}

/* DataTables 样式优化 */
.dataTables_wrapper {
    padding: 20px 0;
}

.dataTables_filter input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
}

.table > thead > tr > th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* 登录注册表单 */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
}

.auth-form .btn {
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 15px;
}

.auth-links a {
    color: #007bff;
    cursor: pointer;
    margin: 0 10px;
}

/* 支付界面 */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.payment-method {
    padding: 20px;
    text-align: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-method:hover {
    border-color: #007bff;
    transform: translateY(-3px);
}

.payment-method.active {
    border-color: #007bff;
    background: #e7f3ff;
}

.payment-method h4 {
    margin: 10px 0;
}

.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.qrcode-container #qrcode {
    margin: 20px 0;
}

/* 推广系统 */
.affiliate-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 32px;
    margin: 10px 0;
}

.stat-card p {
    opacity: 0.9;
}

/* 页面转场动画 */
#app-container {
    min-height: 500px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

#app-container.loading {
    opacity: 0.6;
}

/* 排序按钮 */
.sort-buttons {
    display: inline-block;
    margin-left: 10px;
}

.sort-buttons .btn {
    margin-left: 5px;
}

.sort-buttons .btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 商品介绍 */
.goods-description {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
    line-height: 1.8;
}

.goods-description h4 {
    margin-bottom: 15px;
    color: #333;
}

/* 工具样式 */
.text-danger {
    color: #ff4757 !important;
}

.text-success {
    color: #2ed573 !important;
}

.text-warning {
    color: #ffa502 !important;
}

.text-muted {
    color: #666 !important;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 40px;
}

.loading::after {
    content: "加载中...";
    font-size: 16px;
    color: #666;
}

/* 按钮组 */
.btn-group-sm > .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* 状态标签 */
.label {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
}

.label-default {
    background-color: #777;
    color: white;
}

.label-primary {
    background-color: #337ab7;
    color: white;
}

.label-success {
    background-color: #5cb85c;
    color: white;
}

.label-info {
    background-color: #5bc0de;
    color: white;
}

.label-warning {
    background-color: #f0ad4e;
    color: white;
}

.label-danger {
    background-color: #d9534f;
    color: white;
}
