/* 移动端专用样式文件 - mobile-app.css */

:root {
    /* 参考医械购App的现代化配色 */
    --primary-color: #00c896;
    --primary-dark: #00b385;
    --primary-light: #e6faf6;
    --secondary-color: #4a90e2;
    --success-color: #00c896;
    --danger-color: #ff4757;
    --warning-color: #ffa726;
    --info-color: #26c6da;
    --light-color: #f8fafe;
    --dark-color: #2c3e50;
    --border-color: #e8f4f8;
    --text-primary: #2c3e50;
    --text-secondary: #7b8794;
    --text-muted: #a0a7b0;
    --background-color: #f5f8fa;
    --card-shadow: 0 2px 12px rgba(0,200,150,0.08);
    --hover-shadow: 0 4px 20px rgba(0,200,150,0.15);
    --radius: 16px;
    --radius-small: 12px;
    --radius-large: 20px;
    --mobile-nav-height: 65px;
    --gradient-primary: linear-gradient(135deg, #00c896, #00b385);
    --gradient-card: linear-gradient(135deg, #ffffff, #f8fafe);
}

/* 移动端专用样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--background-color);
    margin: 0;
    padding: 0;
    padding-bottom: calc(var(--mobile-nav-height) + 20px); /* 增加20px间距 */
    -webkit-overflow-scrolling: touch;
    line-height: 1.6;
}

/* 大屏幕时居中显示，最大宽度640px */
.mobile-container {
    max-width: 640px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

@media (min-width: 641px) {
    body {
        background: var(--background-color);
        padding: 20px;
    }
    .mobile-container {
        border-radius: var(--radius-large);
        overflow: hidden;
        box-shadow: 0 8px 40px rgba(0,200,150,0.12);
    }
}

/* 顶部状态栏 */
.status-bar {
    height: 50px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,200,150,0.15);
}

/* 内容区域 */
.main-content {
    background: var(--background-color);
    min-height: calc(100vh - 50px - var(--mobile-nav-height));
    padding-bottom: 20px; /* 确保内容区域有底部间距 */
}

/* 页面容器通用间距 */
.page-container {
    padding-bottom: 20px; /* 为所有页面容器添加底部间距 */
}

/* 特殊页面的额外间距 */
.auth-container,
.categories-container {
    margin-bottom: 20px;
}

/* 卡片样式 */
.app-card {
    background: var(--gradient-card);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

/* 页面进入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 页面动画类 */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* 骨架屏加载动画 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line {
    height: 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 150px;
    border-radius: 12px;
}

/* 提升按钮样式 */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-small);
    font-weight: 600;
    padding: 12px 24px;
    box-shadow: 0 4px 12px rgba(0,200,150,0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,200,150,0.4);
    background: var(--gradient-primary);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 优化输入框样式 */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,200,150,0.1);
    outline: none;
}

/* 搜索栏美化 */
.search-bar {
    padding: 15px;
    background: white;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    background: var(--light-color);
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 2px 12px rgba(0,200,150,0.15);
    outline: none;
}

/* 产品卡片样式优化 */
.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.product-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-info {
    padding: 12px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.btn-inquiry {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-inquiry:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}

/* 商家信息美化 */
.merchant-info {
    display: flex;
    align-items: center;
    padding: 15px;
    transition: background-color 0.2s ease;
}

.merchant-info:hover {
    background-color: var(--light-color);
}

.merchant-logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-small);
    margin-right: 12px;
}

.merchant-name {
    flex-grow: 1;
}

/* 标签美化 */
.tag {
    display: inline-block;
    padding: 4px 8px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.tag.featured {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #8b5a00;
}

/* 底部导航优化 */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 640px;
    height: var(--mobile-nav-height);
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    padding: 8px 4px;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 50px;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.05);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* Toast 消息样式 */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: white;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 10px;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* 模态框美化 */
.modal-content {
    border: none;
    border-radius: var(--radius-large);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
}

.modal-title {
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    background: var(--light-color);
    border-radius: 50%;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--danger-color);
    opacity: 1;
}

/* 列表组美化 */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background: var(--light-color);
    transform: translateX(4px);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* 轮播图指示器美化 */
.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    border: none;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.carousel-indicators [data-bs-target].active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* 响应式优化 */
@media (max-width: 480px) {
    .product-image {
        height: 100px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 13px;
    }
    
    .btn-inquiry {
        padding: 3px 8px;
        font-size: 11px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 选择状态美化 */
::selection {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 焦点状态统一 */
button:focus,
.btn:focus {
    box-shadow: 0 0 0 3px rgba(0,200,150,0.2);
    outline: none;
}
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

/* 底部导航 */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 640px;
    width: 100%;
    height: var(--mobile-nav-height);
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,200,150,0.08);
    backdrop-filter: blur(10px);
    margin-top: 10px; /* 增加上方间距 */
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

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

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 搜索栏 */
.search-bar {
    background: white;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 14px 20px;
    width: 100%;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,200,150,0.15);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* 分类网格 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.category-item {
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: translateY(-3px);
}

.category-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: white;
    font-size: 26px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.category-item:hover .category-icon {
    box-shadow: var(--hover-shadow);
    transform: scale(1.05);
}

.category-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-3px);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--light-color);
    transition: all 0.3s ease;
}

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

.product-info {
    padding: 16px;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--danger-color);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 商家信息 */
.merchant-info {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid var(--border-color);
}

.merchant-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.merchant-name {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
}

/* 按钮样式 */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-small);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.btn-primary:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

.btn-inquiry {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,200,150,0.2);
}

.btn-inquiry:hover {
    box-shadow: 0 4px 15px rgba(0,200,150,0.3);
    transform: translateY(-1px);
}

/* 标签 */
.tag {
    background: var(--light-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 4px;
}

.tag.featured {
    background: var(--warning-color);
    color: white;
}

/* 工具栏 */
.toolbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 模态框优化 */
.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
}

/* 轮播图优化 */
.carousel-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.carousel-indicators {
    bottom: 10px;
}

.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 2px;
}

/* 响应式隐藏 */
@media (max-width: 640px) {
    .d-mobile-none { display: none !important; }
}

@media (min-width: 641px) {
    .d-desktop-none { display: none !important; }
}

/* Banner轮播图样式优化 */
#bannerCarousel {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,200,150,0.1);
}

#bannerCarousel .carousel-control-prev,
#bannerCarousel .carousel-control-next {
    width: 10%;
    opacity: 0.8;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
}

#bannerCarousel .carousel-control-prev {
    left: 15px;
}

#bannerCarousel .carousel-control-next {
    right: 15px;
}

#bannerCarousel .carousel-control-prev:hover,
#bannerCarousel .carousel-control-next:hover {
    opacity: 1;
    background: rgba(0,200,150,0.2);
}

#bannerCarousel .carousel-indicators {
    margin-bottom: 15px;
}

#bannerCarousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: rgba(255,255,255,0.5);
    border: 2px solid rgba(255,255,255,0.8);
}

#bannerCarousel .carousel-indicators button.active {
    background-color: #00c896;
    border-color: #00c896;
    transform: scale(1.2);
}

#bannerCarousel .carousel-item img {
    transition: transform 0.5s ease;
    border-radius: 16px;
}

#bannerCarousel .carousel-item:hover img {
    transform: scale(1.02);
}

/* 优化标题样式 */
.section-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
}

/* 优化商品卡片间距 */
.product-grid {
    gap: 16px;
}

/* 分类页面样式优化 */
.hover-bg-light:hover {
    background-color: #f8fafe !important;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

.category-parent-item {
    border-radius: 12px !important;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent !important;
}

.category-parent-item:hover {
    background-color: #f0f9f6 !important;
    border-color: #e6faf6 !important;
}

.category-parent-item.active {
    background: linear-gradient(135deg, #00c896, #00b385) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(0,200,150,0.3);
}

.category-parent-item.active .text-primary {
    color: white !important;
}

.category-parent-item.active .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

.category-parent-item.active:hover {
    background: linear-gradient(135deg, #00b385, #009975) !important;
    transform: translateY(-2px);
}

/* 右侧二级分类样式优化 */
#subCategoryContent .border {
    border: 1px solid #e8f4f8 !important;
    border-radius: 12px !important;
    transition: all 0.3s ease;
}

#subCategoryContent .border:hover {
    border-color: #00c896 !important;
    box-shadow: 0 4px 15px rgba(0,200,150,0.15);
    transform: translateY(-2px);
}

#subCategoryContent .text-primary {
    color: #00c896 !important;
}
