/**
 * 前台样式 - 明亮圆润风格
 * Auto Card System - 自动发卡系统
 * Version: 3.0 Light & Round Theme
 */

/* ========== CSS Variables ========== */
:root {
    /* 主色调 - 清新蓝紫 */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-lighter: #c7d2fe;
    --primary-dark: #4f46e5;
    
    /* 辅助色 */
    --accent-color: #f472b6;
    --accent-light: #fbcfe8;
    --success-color: #22c55e;
    --success-light: #bbf7d0;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --danger-color: #ef4444;
    --danger-light: #fecaca;
    --info-color: #06b6d4;
    --info-light: #cffafe;
    
    /* 背景色 - 明亮系 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    
    /* 文字色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* 边框 */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);
    --shadow-colored: 0 8px 24px rgba(99, 102, 241, 0.15);
    
    /* 圆角 */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
}

/* ========== 全局样式 ========== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ========== 导航栏 ========== */
.navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 600;
    padding: 0.6rem 1.2rem !important;
    margin: 0 0.15rem;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background: var(--primary-lighter);
}

.navbar-nav .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: var(--shadow-colored);
}

.navbar-toggler {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
}

.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(99, 102, 241, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========== 公告栏 ========== */
.announcement-bar {
    background: linear-gradient(90deg, var(--warning-light), rgba(254, 243, 199, 0.5)) !important;
    border-bottom: none;
    padding: 0.6rem 0;
    border-radius: 0;
}

.announcement-bar .bg-warning-subtle {
    background: transparent !important;
}

.announcement-bar marquee {
    font-weight: 600;
    color: #b45309;
}

.announcement-bar i {
    color: var(--warning-color);
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 180px);
}

.container {
    max-width: 1200px;
}

/* ========== 标题样式 ========== */
h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
}

h4 i {
    color: var(--primary-color);
}

/* ========== 卡片样式 ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* 移动端禁用卡片 hover 效果，防止触摸时抖动 */
@media (max-width: 768px) {
    .card:hover,
    .card:active,
    .card:focus {
        transform: none;
    }
    
    .product-card:hover,
    .product-card:active {
        transform: none;
    }
    
    .btn:hover,
    .btn:active {
        transform: none !important;
    }
}

.card-header {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary)) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info {
    background: linear-gradient(135deg, var(--primary-lighter), rgba(199, 210, 254, 0.3)) !important;
    color: var(--primary-dark) !important;
}

.card-header h5 {
    margin: 0;
    color: var(--text-primary);
}

.card-header i {
    color: var(--primary-color);
}

.card-body {
    padding: 1.25rem;
}

/* ========== 分类侧边栏 ========== */
.category-sidebar {
    position: sticky;
    top: 90px;
}

.category-sidebar .card-header {
    font-size: 0.95rem;
}

.category-filter-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
}

.category-filter-inline .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
}

/* ========== 商品卡片 ========== */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-lighter);
}

.product-card .product-media {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-tertiary), #fff);
}

.product-card .product-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.product-card .product-image.placeholder {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--bg-tertiary), #fff);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.product-card .card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--danger-color);
}

/* ========== 徽章样式 ========== */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.8rem;
}

.badge.bg-success {
    background: var(--success-light) !important;
    color: #15803d !important;
}

.badge.bg-primary {
    background: var(--primary-lighter) !important;
    color: var(--primary-dark) !important;
}

.badge.bg-info {
    background: var(--info-light) !important;
    color: #0e7490 !important;
}

.badge.bg-warning {
    background: var(--warning-light) !important;
    color: #b45309 !important;
}

.badge.bg-danger {
    background: var(--danger-light) !important;
    color: #b91c1c !important;
}

/* ========== 按钮样式 ========== */
.btn {
    border-radius: var(--radius-full);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

/* ========== 表单样式 ========== */
.form-control {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-select {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    /* 使用单一下拉箭头图标 */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236366f1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    /* 隐藏浏览器默认箭头 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

/* 兼容IE浏览器，隐藏原生箭头 */
.form-select::-ms-expand {
    display: none;
}

/* 输入组 */
.input-group .btn {
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.input-group .btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.input-group .form-control {
    border-left: none;
    border-right: none;
    border-radius: 0;
}

.input-group > :first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group > :last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 按钮组 - 联系方式选择 */
.btn-group .btn-check:checked + .btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-group .btn-outline-primary {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.btn-group .btn-outline-primary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-lighter);
}

/* ========== 警告框样式 ========== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 1rem 1.25rem;
}

.alert-warning {
    background: var(--warning-light);
    color: #b45309;
}

.alert-info {
    background: var(--info-light);
    color: #0e7490;
}

.alert-danger {
    background: var(--danger-light);
    color: #b91c1c;
}

.alert-success {
    background: var(--success-light);
    color: #15803d;
}

.alert-light {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ========== 支付方式区域 ========== */
.pay-types-grid {
    gap: 0.6rem !important;
}

.pay-types-grid .pay-type-btn {
    padding: 0.7rem 0.5rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.pay-types-grid .pay-type-btn:hover {
    border-color: var(--primary-lighter);
    background: white;
}

.pay-types-grid .btn-check:checked + .pay-type-btn {
    background: linear-gradient(135deg, var(--primary-lighter), rgba(199, 210, 254, 0.5));
    border-color: var(--primary-color);
    color: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.pay-types-grid .pay-type-icon {
    font-size: 1.4rem;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.pay-types-grid .pay-type-text {
    font-size: 0.78rem;
    font-weight: 600;
}

/* ========== 商品详情页 ========== */
.product-detail {
    display: grid;
    gap: 1.25rem;
}

.product-detail .product-media {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-tertiary), #fff);
    border: 1px solid var(--border-color);
}

.product-detail .product-image {
    width: 100%;
    height: 280px;
    object-fit: contain;
    display: block;
}

.product-detail .product-image.placeholder {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin-top: 1rem;
}

.info-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.info-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.info-item .value {
    font-weight: 700;
    color: var(--text-primary);
}

.product-params {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-params .param-item {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
}

/* 移动端底部支付栏 - 仅在移动端显示 */
@media (max-width: 767.98px) {
    .mobile-pay-bar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        z-index: 1040;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
    }
    
    /* 当有模态框打开时，隐藏移动端支付栏 */
    body.modal-open .mobile-pay-bar {
        display: none !important;
    }
}

/* 电脑端隐藏移动支付栏 */
@media (min-width: 768px) {
    .mobile-pay-bar {
        display: none !important;
    }
}

.mobile-pay-bar .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mobile-pay-bar .amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--danger-color);
}

.mobile-pay-btn {
    padding: 0.7rem 1.8rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    white-space: nowrap;
}

/* ========== 分页 ========== */
.pagination .page-link {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin: 0 0.15rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-weight: 600;
}

.pagination .page-link:hover {
    background: var(--primary-lighter);
    border-color: var(--primary-lighter);
    color: var(--primary-dark);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-colored);
}

.pagination .page-item.disabled .page-link {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* ========== 面包屑 ========== */
.breadcrumb {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ========== 表格样式 ========== */
.table {
    color: var(--text-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-lighter), rgba(199, 210, 254, 0.3));
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.table-light {
    background: transparent !important;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

.table-hover tbody tr:hover {
    background: var(--primary-lighter);
}

/* ========== 模态框 ========== */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-lighter), rgba(199, 210, 254, 0.3));
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.modal-header.bg-success,
.modal-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-lighter), rgba(199, 210, 254, 0.3)) !important;
}

.modal-header .modal-title {
    color: var(--primary-dark);
    font-weight: 700;
}

.modal-header .btn-close {
    opacity: 0.6;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* 移动端模态框稳定性 */
@media (max-width: 768px) {
    .modal {
        -webkit-overflow-scrolling: touch;
        /* 禁用可能导致抖动的属性 */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000;
        perspective: 1000;
    }
    
    .modal-dialog {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        /* 禁用动画 */
        transform: none !important;
        transition: none !important;
    }
    
    .modal-content {
        transform: none !important;
        animation: none !important;
        /* 防止触摸时抖动 */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .modal.fade .modal-dialog,
    .modal.show .modal-dialog {
        transform: none !important;
        transition: none !important;
    }
    
    /* 禁用 Bootstrap 的 fade 动画 */
    .modal.fade {
        opacity: 1 !important;
        transition: none !important;
    }
    
    .modal.fade.show {
        opacity: 1 !important;
    }
    
    /* 确保弹窗背景可点击关闭 */
    .modal-backdrop {
        pointer-events: auto;
        opacity: 0.5 !important;
        transition: none !important;
    }
    
    .modal-backdrop.fade {
        opacity: 0.5 !important;
    }
    
    /* 弹窗内按钮禁用 hover 效果 */
    .modal .btn:hover,
    .modal .btn:active,
    .modal .btn:focus {
        transform: none !important;
    }
    
    /* 弹窗内的 alert 禁用动画 */
    .modal .alert {
        animation: none !important;
        transition: none !important;
    }
}

/* ========== 页脚 ========== */
.footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    margin-top: 4rem;
    padding: 2.5rem 0 1.5rem;
}

.footer h5, .footer h6 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer h5 i {
    color: var(--primary-color);
}

.footer .text-muted {
    color: var(--text-muted) !important;
}

.footer p {
    color: var(--text-secondary);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--primary-dark);
}

.footer hr {
    border-color: var(--border-color);
    opacity: 0.5;
}

/* ========== 代码块 ========== */
pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: auto;
}

/* ========== 加载动画 ========== */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2em;
    color: var(--primary-color);
}

/* ========== 动画效果 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .category-sidebar {
        position: static;
    }
    
    .category-filter-inline {
        display: flex;
        flex-wrap: wrap;
    }
    
    .product-card .product-media {
        display: none;
    }
    
    .product-card .card-body {
        padding: 1rem;
    }
    
    .product-card .price {
        font-size: 1.25rem;
    }
    
    .buy-layout .product-detail {
        display: block;
    }
    
    .buy-layout .product-detail .product-media {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .buy-layout .product-detail .product-image,
    .buy-layout .product-detail .product-image.placeholder {
        height: 200px;
    }
    
    .buy-layout .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .buy-layout .order-card {
        padding-bottom: 5rem;
    }
    
    .product-params .param-item {
        font-size: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    h4 {
        font-size: 1.25rem;
    }
    
    /* ========== 移动端查询页面优化 ========== */
    /* 隐藏桌面表格，显示移动端卡片 */
    .query-result-table {
        display: none !important;
    }
    
    .query-result-mobile {
        display: block !important;
    }
    
    /* 移动端订单卡片 */
    .order-card-mobile {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-bottom: 0.75rem;
        transition: all 0.3s ease;
    }
    
    .order-card-mobile:last-child {
        margin-bottom: 0;
    }
    
    .order-card-mobile:hover {
        box-shadow: var(--shadow-md);
    }
    
    .order-card-mobile .order-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px dashed var(--border-color);
    }
    
    .order-card-mobile .order-no {
        font-size: 0.75rem;
        color: var(--text-muted);
        word-break: break-all;
        max-width: 65%;
    }
    
    .order-card-mobile .order-body {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
        align-items: center;
    }
    
    .order-card-mobile .product-name {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 0.95rem;
    }
    
    .order-card-mobile .order-amount {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--danger-color);
        text-align: right;
    }
    
    .order-card-mobile .order-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-light);
        flex-wrap: wrap;
    }
    
    .order-card-mobile .order-actions .btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* 查询表单移动端优化 */
    .query-form .row.g-3 {
        flex-direction: column;
    }
    
    .query-form .col-md-8,
    .query-form .col-md-4 {
        width: 100%;
    }
    
    .query-form .btn {
        margin-top: 0.5rem;
    }
}

/* 桌面端显示表格，隐藏移动端卡片 */
@media (min-width: 769px) {
    .query-result-table {
        display: block !important;
    }
    
    .query-result-mobile {
        display: none !important;
    }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-lighter);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ========== 选择高亮 ========== */
::selection {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

/* ========== 文字样式 ========== */
.text-danger {
    color: var(--danger-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: #b45309 !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ========== 背景样式 ========== */
.bg-light {
    background: var(--bg-tertiary) !important;
}

/* ========== 分隔线 ========== */
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
    opacity: 0.5;
}

/* ========== 加载状态 ========== */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast动画 */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
