/* ============================================
   TCONLINE - 全局样式
   基于Bootstrap 5的自定义深色主题
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* CSS变量 - Light Mode */
:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Light Theme Backgrounds */
    --bg-dark: #f8f9fa;
    /* Main Body BG */
    --bg-card: #ffffff;
    /* Card BG */
    --bg-card-hover: #f1f5f9;
    /* Hover BG */
    --bg-input: #ffffff;
    /* Input BG */
    --bg-sidebar: #ffffff;
    /* Sidebar BG */

    /* Light Theme Text */
    --text-primary: #1e293b;
    /* Dark Text */
    --text-secondary: #64748b;
    /* Gray Text */
    --text-muted: #94a3b8;
    /* Muted Text */

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --transition: all 0.3s ease;

    --sidebar-width: 260px;
    --header-height: 65px;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

/* ============================================
   登录页面
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0e7ff 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .logo h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .logo p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 5px;
}

/* ============================================
   表单样式
   ============================================ */
.form-control,
.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-input);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.input-group-text {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* ============================================
   按钮样式
   ============================================ */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 8px 20px;
    font-size: 14px;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #059669, var(--success));
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, var(--danger));
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, var(--warning));
    color: #fff;
}

.btn-info {
    background: linear-gradient(135deg, #0891b2, var(--info));
    color: #fff;
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary-light);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ============================================
   布局 - 侧边栏+主内容
   ============================================ */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-brand h4 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.sidebar-brand small {
    color: var(--text-muted);
    font-size: 11px;
}

.sidebar-nav {
    padding: 15px 0;
    list-style: none;
}

.sidebar-nav .nav-section {
    padding: 15px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav .nav-section i {
    font-size: 14px;
    opacity: 0.7;
}

.sidebar-nav .nav-item {
    margin: 2px 10px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.sidebar-nav .nav-link:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(99, 102, 241, 0.05));
    color: var(--primary);
    border-left: 4px solid var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 18px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.sidebar-nav .nav-link.active i,
.sidebar-nav .nav-link:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* ============================================
   顶部导航
   ============================================ */
.top-header {
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header .page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.top-header .header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-header .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.top-header .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

/* ============================================
   内容区域
   ============================================ */
.content-wrapper {
    padding: 15px;
}

@media (min-width: 768px) {
    .content-wrapper {
        padding: 25px;
    }
}

/* ============================================
   卡片
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* 统计卡片 */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 15px;
}

.stat-card .stat-icon.bg-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.stat-card .stat-icon.bg-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.stat-card .stat-icon.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.stat-card .stat-icon.bg-info {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    color: #fff;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
}

.stat-card .stat-icon.bg-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.stat-card .stat-icon.bg-purple {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: #fff;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ============================================
   表格
   ============================================ */
.table {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.table thead th {
    background: #f1f5f9;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    padding: 12px 15px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 14px;
}

/* 响应式表格容器 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table thead {
        display: none;
        /* 在移动端可以考虑隐藏表头或使用其它方式 */
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        background: var(--bg-card);
    }

    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid var(--border-light);
    }

    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--text-secondary);
    }

    .table td:last-child {
        border-bottom: none;
    }
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8fafc;
}

/* ============================================
   徽章/标签
   ============================================ */
.badge {
    font-weight: 500;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge.bg-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: var(--warning);
}

.badge.bg-info {
    background: rgb(183 0 0) !important;
    color: #ffffff;
}

.badge.bg-primary {
    background: rgba(79, 70, 229, 0.2) !important;
    color: var(--primary-light);
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: var(--success);
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: var(--danger);
}

.badge.bg-secondary {
    background: rgba(100, 116, 139, 0.2) !important;
    color: var(--text-muted);
}

/* ============================================
   分页样式
   ============================================ */
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.pagination .page-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* ============================================
   用户端 - 商品卡片
   ============================================ */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Horizontal Scroll Container */
.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    margin: 0 -0.5rem;
    /* Negative margin to align first item */
    padding: 0 0.5rem 1rem 0.5rem;
    /* Padding for scroll spacing */
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.horizontal-scroll-container .col-6 {
    flex: 0 0 auto;
    width: 160px;
    /* Mobile width */
}

@media (min-width: 768px) {
    .horizontal-scroll-container .col-6 {
        width: 200px;
        /* Tablet width */
    }
}

@media (min-width: 1200px) {
    .horizontal-scroll-container .col-6 {
        width: 220px;
        /* Desktop width */
    }
}

/* Horizontal Scroll Grid (2 Rows) */
.horizontal-scroll-grid-2rows {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    /* 2 Rows fixed */
    grid-auto-flow: column;
    /* Flow sideways */
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 -0.5rem;
    padding: 0 0.5rem 1rem 0.5rem;
}

.horizontal-scroll-grid-2rows::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll-grid-2rows .product-item {
    width: 160px;
    /* Mobile width */
}

@media (min-width: 768px) {
    .horizontal-scroll-grid-2rows .product-item {
        width: 200px;
        /* Tablet width */
    }
}

@media (min-width: 1200px) {
    .horizontal-scroll-grid-2rows .product-item {
        width: 220px;
        /* Desktop width */
    }
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.product-card .product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-card-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 40px;
    position: relative;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .product-info {
    padding: 15px;
}

.product-card .product-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.curr-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
}

.orig-price {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card .product-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 39px;
}

.product-card .product-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.product-card .product-price small {
    font-size: 13px;
    font-weight: 400;
}

.product-card .product-shop {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* 标签 */
.product-card .product-tags {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    opacity: 1 !important;
    visibility: visible !important;
}


.product-card .tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.tag-hot {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.tag-new {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.tag-recommend {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
}

/* 折扣标签 - 确保常驻显示 */
.product-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    /* 防止遮挡图片点击 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: block !important;
    opacity: 1 !important;
}


/* ============================================
   用户端 - 首页轮播
   ============================================ */
.hero-carousel .carousel-item {
    height: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-carousel .carousel-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

/* ============================================
   购物车
   ============================================ */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

@media (max-width: 576px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item .item-image {
        margin-bottom: 10px;
    }

    .cart-item .item-price {
        text-align: left;
        margin-top: 10px;
        min-width: auto;
    }
}

.cart-item:hover {
    background: var(--bg-card-hover);
}

.cart-item .item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: var(--bg-card-hover);
    margin-right: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item .item-info {
    flex: 1;
}

.cart-item .item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item .item-sku {
    font-size: 12px;
    color: var(--text-muted);
}

.cart-item .item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--danger);
    min-width: 100px;
    text-align: right;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-control button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.quantity-control input {
    width: 50px;
    text-align: center;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 4px;
    height: 30px;
}

/* ============================================
   模态框
   ============================================ */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.modal-header .modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
}

/* ============================================
   Toast消息提示
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    min-width: 280px;
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .hero-carousel .carousel-item {
        height: 180px;
    }
}

/* ============================================
   滚动条美化
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============================================
   动画
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h5 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   用户端顶部导航（无侧边栏）
   ============================================ */
.user-navbar {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.user-navbar .navbar-brand {
    font-weight: 700;
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-navbar .nav-link {
    color: var(--text-secondary) !important;
    font-size: 14px;
    padding: 8px 15px !important;
    transition: var(--transition);
}

.user-navbar .nav-link:hover,
.user-navbar .nav-link.active {
    color: var(--primary-light) !important;
}

.user-navbar .cart-badge {
    position: relative;
}

.user-navbar .cart-badge .badge {
    position: absolute;
    top: 2px;
    right: 5px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
}

/* 移动端常驻购物车图标 */
.navbar-mobile-cart {
    position: relative;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 22px;
    display: flex;
    align-items: center;
    margin-right: 5px;
}

.navbar-mobile-cart .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
}

/* 移动端常驻语言切换 */
.navbar-mobile-lang {
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 20px;
    display: flex;
    align-items: center;
    margin-right: 2px;
}

.navbar-mobile-lang:hover {
    color: var(--primary-light);
}



/* ============================================
   用户端页面内容区
   ============================================ */
.user-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 10px;
}

@media (min-width: 768px) {
    .user-content {
        padding: 25px 15px;
    }
}

/* ============================================
   搜索栏
   ============================================ */
.search-bar {
    position: relative;
}

.search-bar .form-control {
    padding-left: 40px;
    border-radius: 25px;
    background: var(--bg-card);
}

.search-bar .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============================================
   商品详情
   ============================================ */
.product-detail-image {
    width: 100%;
    height: 400px;
    background: var(--bg-card-hover);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sku-option {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.sku-option:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.sku-option.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
}

/* ============================================
   订单时间线
   ============================================ */
.order-timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.order-timeline li {
    position: relative;
    padding: 10px 0 10px 40px;
}

.order-timeline li::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid var(--bg-card);
}

.order-timeline li.active::before {
    background: var(--primary);
}

.order-timeline .timeline-time {
    font-size: 12px;
    color: var(--text-muted);
}

.order-timeline .timeline-desc {
    font-size: 14px;
    color: var(--text-primary);
}

/* 轮播图响应式 */
.hero-slider-img {
    height: 400px;
    object-fit: cover;
}

@media (max-width: 768px) {

    .hero-carousel .carousel-item,
    .hero-slider-img {
        height: auto;
        aspect-ratio: 1200 / 400;
    }
}

/* 搜索清除按钮 */
.search-wrapper {
    position: relative;
    display: inline-block;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    z-index: 5;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--danger);
}

.form-control.has-clear {
    padding-right: 35px;
}

/* ============================================
   商品详情页 - 图片库
   ============================================ */
.product-detail-image {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.product-detail-image .carousel-item {
    background: #fff !important;
}

.product-detail-image .carousel-item img {
    height: 450px !important;
    object-fit: contain;
    padding: 20px;
}

.product-thumbnails {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.product-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.product-thumbnails::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 10px;
}

.thumb-item {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
    border: 1px solid var(--border-color);
}

.thumb-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.thumb-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
    transform: translateY(-2px);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 商品大图左右箭头 */
.img-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.img-nav-arrow:hover {
    background: rgba(0, 0, 0, 0.55);
    transform: translateY(-50%) scale(1.1);
}

.img-nav-prev {
    left: 12px;
}

.img-nav-next {
    right: 12px;
}

@media (max-width: 768px) {
    .img-nav-arrow {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .img-nav-prev {
        left: 6px;
    }

    .img-nav-next {
        right: 6px;
    }
}