/* ========================================
   小红书账号交易平台 - 全局样式
   ======================================== */

/* 基础变量 */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #4a4a4a;
    --accent-color: #ff2442;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

/* 全局样式 */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: var(--primary-color);
    line-height: 1.6;
}

/* 渐变背景 */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

/* ========================================
   公告栏
   ======================================== */
.notice-bar {
    background: var(--primary-color);
    font-size: 0.9rem;
}

.notice-bar .notice-text {
    animation: marquee 20s linear infinite;
}

/* ========================================
   PC端导航栏
   ======================================== */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1.4rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--secondary-color) !important;
    margin: 0 0.5rem;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* ========================================
   页面标题
   ======================================== */
.page-header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   筛选标签
   ======================================== */
.filter-tags .btn {
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.filter-tags .btn-outline-dark:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   搜索区
   ======================================== */
.search-section .input-group {
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.search-section .input-group-text {
    border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);
    padding-left: 1rem;
}

.search-section .form-control {
    border-radius: 0;
    font-size: 1rem;
}

.search-section .form-control:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

.search-section .btn {
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ========================================
   平台分类标签
   ======================================== */
.platform-tags .btn {
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.platform-tags .btn-outline-dark:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========================================
   筛选表单区
   ======================================== */
.filter-section {
    border: 1px solid #f0f0f0;
}

.filter-section .form-label {
    font-size: 0.75rem;
    font-weight: 500;
}

.filter-section .form-select,
.filter-section .form-control {
    border-color: #e0e0e0;
    font-size: 0.875rem;
}

.filter-section .form-select:focus,
.filter-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(26, 26, 26, 0.1);
}

/* ========================================
   商品卡片
   ======================================== */
.product-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-card .card-image {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.product-card .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.05);
}

.product-card .gender-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.product-card .gender-badge.female {
    background: rgba(255, 182, 193, 0.9);
    color: #c2185b;
}

.product-card .gender-badge.male {
    background: rgba(135, 206, 235, 0.9);
    color: #1565c0;
}

.product-card .gender-badge.mixed {
    background: rgba(200, 200, 200, 0.9);
    color: #555;
}

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

.product-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.product-card .card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-card .card-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.product-card .card-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.product-card .card-stats i {
    font-size: 0.85rem;
}

/* ========================================
   商品详情页
   ======================================== */
.product-detail-image {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

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

.product-detail-image .gender-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.price-tag {
    font-size: 2rem;
    color: var(--primary-color);
}

.price-tag .currency {
    font-size: 1.2rem;
}

.price-tag .amount {
    font-weight: 700;
}

.account-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

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

.stat-item i {
    font-size: 1.2rem;
    color: var(--bg-gradient-start);
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.stat-item .stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* ========================================
   移动端TabBar
   ======================================== */
.mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 1000;
}

.tabbar-container {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
}

.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--secondary-color);
    padding: 0.3rem 1rem;
    transition: var(--transition);
}

.tabbar-item i {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.tabbar-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.tabbar-item.active {
    color: var(--primary-color);
}

/* ========================================
   订单列表
   ======================================== */
.order-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.order-card:hover {
    box-shadow: var(--shadow-md);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.order-id {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.order-status.success {
    background: #d4edda;
    color: #155724;
}

.order-body {
    display: flex;
    padding: 1rem;
    gap: 1rem;
}

.order-image {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.order-info {
    flex: 1;
}

.order-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.order-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid #f0f0f0;
}

.order-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ========================================
   个人中心
   ======================================== */
.profile-card {
    position: relative;
    overflow: hidden;
}

.profile-avatar {
    width: 70px;
    height: 70px;
}

.profile-stats .stat-value {
    font-size: 1.5rem;
}

.menu-card {
    overflow: hidden;
}

.menu-item {
    transition: var(--transition);
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon i {
    font-size: 1.2rem;
}

/* ========================================
   弹窗样式
   ======================================== */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem 1.5rem 0;
}

.modal-body {
    padding: 1.5rem;
}

.order-summary {
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.success-icon i {
    font-size: 4rem;
}

.account-info {
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.account-info code {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* ========================================
   空状态
   ======================================== */
.empty-icon i {
    font-size: 5rem;
    opacity: 0.5;
}

/* ========================================
   响应式布局
   ======================================== */

/* 最大宽度限制 */
.container {
    max-width: 1280px !important;
}

/* PC端：商品卡片一行5个 */
@media (min-width: 1200px) {
    .product-grid .col-xl-2-4 {
        flex: 0 0 auto;
        width: 20%;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .product-grid .col-lg-2-4 {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* 移动端适配 */
@media (max-width: 991px) {
    .main-content {
        padding-bottom: 80px;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .product-detail-image {
        margin-bottom: 1.5rem;
    }

    .price-tag {
        font-size: 1.5rem;
    }

    .account-stats {
        gap: 1rem;
        padding: 0.75rem;
    }

    .stat-item {
        font-size: 0.85rem;
    }

    .profile-avatar {
        width: 60px;
        height: 60px;
    }

    .profile-avatar i {
        font-size: 1.5rem !important;
    }
}

/* 移动端一行2个 */
@media (max-width: 767px) {
    .product-grid .col-6 {
        padding: 0.375rem;
    }

    .product-card .card-title {
        font-size: 0.85rem;
    }

    .product-card .card-price {
        font-size: 1.1rem;
    }

    .product-card .card-stats {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .order-body {
        flex-direction: column;
    }

    .order-image {
        width: 100%;
        height: 150px;
    }

    /* 移动端搜索框占满宽度 */
    .search-section .search-box {
        max-width: 100% !important;
        padding: 0 0.5rem;
    }

    .search-section .input-group-lg .form-control {
        font-size: 0.9rem;
    }

    .search-section .btn {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* 个人中心统计卡片一行3个 */
    .profile-stats {
        display: flex;
        justify-content: space-around;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* 按钮点击效果 */
.btn {
    transition: var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   工具类
   ======================================== */
.cursor-pointer {
    cursor: pointer;
}

.text-gradient {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rounded-4 {
    border-radius: var(--border-radius-lg) !important;
}
