/* 移动端优化CSS样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    
    background-color: #f0f2f5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

/* 设计容器 */
.design-container {
    width: 100%;
    max-width: 768px;
    min-height: 100vh;
    background: #FFFFFF;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* 防止缩放和选择 */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* 触摸优化 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 顶部导航 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    padding-top: calc(15px + env(safe-area-inset-top));
    background: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.profile {
    display: flex;
    align-items: center;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-image: linear-gradient(45deg, #4e54c8, #8f94fb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 16px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.app-actions {
    display: flex;
    gap: 18px;
}

.action-btn {
    font-size: 20px;
    color: #2d3748;
    position: relative;
    cursor: pointer;
    transition: color 0.3s ease;
}

.action-btn:hover {
    color: #4f46e5;
}

.notification-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
}

/* 搜索栏 */


/* 分类标签 */
.categories {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-item {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-item:hover {
    background: #e2e8f0;
}

.category-item.active {
    background: #4f46e5;
    color: white;
}

.category-item.has-children::after {
    content: '▼';
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
}

.category-item.back-item {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: #4f46e5;
}

.category-item.back-item:hover {
    background: rgba(79, 70, 229, 0.2);
}

.category-name {
    flex: 1;
}

.category-count {
    font-size: 12px;
    opacity: 0.8;
    font-weight: normal;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.3);
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0;
}

.page {
    display: none;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* 瀑布流展示区域 - CSS Grid布局 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 10px;
    justify-content: center;
    padding: 10px;
    grid-auto-rows: 10px;
    /* row-gap: 8px; */
    min-height: 200px;
    width: 100%;
    margin-top: 10px;
}

/* 响应式媒体查询已移除，只保留移动端样式 */

/* 响应式设计 */
/* 移动端样式直接应用到基础样式中 */
.top-nav {
    padding: 12px 15px;
    padding-top: calc(12px + env(safe-area-inset-top));
}



.categories {
    padding: 0;
}

.bottom-nav {
    padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

/* 旧的响应式布局已移除，使用新的瀑布流设计 */

/* 桌面端样式已移除 */

.image-card {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: #fff;
    /* border: 1px solid rgba(0, 0, 0, 0.04); */
    box-sizing: border-box;
}

/* 图片加载状态 - 优化版 */
.image-card.loading {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.image-card.loaded {
    animation: fadeInScale 0.4s ease-out;
}

.image-card.error {
    background: #f8f9fa;
    border-color: rgba(220, 53, 69, 0.1);
}

.image-card.error .image-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(79, 70, 229, 0.2);
}

.image-card:active {
    transform: translateY(-2px);
    transition: all 0.1s ease;
}

.image-placeholder {
    width: 100%;
    position: relative;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    overflow: hidden;
    border-radius: 12px;
    /* padding-bottom will be set by JavaScript based on aspect ratio */
}

.image-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(1) contrast(1);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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


/* 加载状态 - 移除脉冲效果 */
.image-card.loading {
    animation: shimmer 1.5s infinite;
}

/* 响应式样式已整合到瀑布流布局中 */

/* 图片编号样式 - 右上角优化 */
.image-number {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.7));
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    z-index: 3;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}

.image-number:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 15px 12px;
    color: white;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.2;
}

.card-author {
    display: flex;
    align-items: center;
    font-size: 12px;
    opacity: 0.9;
}

.author-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    margin-right: 8px;
    flex-shrink: 0;
}

/* 首页样式 */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 30px;
}

.hero-section h2 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero-section p {
    font-size: 16px;
    margin-bottom: 25px;
    opacity: 0.9;
}

.cta-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 44px;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}

@media (min-width: 480px) {
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.feature-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.feature-card p {
    color: #666;
    font-size: 14px;
}

/* 产品页面样式 */
.product-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* 产品列表保持单列布局 */

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    background: linear-gradient(45deg, #f0f2f5, #e9ecef);
    position: relative;
}

.product-image::after {
    content: '📷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    opacity: 0.5;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.product-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.price {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    display: block;
    margin-bottom: 15px;
}

.add-to-cart {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-height: 44px;
}

.add-to-cart:hover {
    background: #5a6fd8;
}

/* 服务页面样式 */
.services-list {
    margin-top: 20px;
}

/* 已删除未使用的service-item和about-content样式 */

/* 联系表单样式 */
.contact-form-container {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.contact-form-container h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.contact-form {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-top: 20px;
    max-width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    color: #2d3748;
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

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

/* 底部导航栏 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    bottom: 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 50px;
    text-align: center;
}

.nav-item:hover {
    background: #f1f5f9;
}

.nav-item.active {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
}

.nav-item i {
    font-size: 18px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 加载更多 - 优化版 */
.load-more-container {
    text-align: center;
    padding: 24px 20px;
    margin-top: 16px;
}

.load-more-container .loading-indicator {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 16px 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

.loading-indicator.show {
    display: flex;
}

.loading-indicator .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.no-more-data {
    text-align: center;
    padding: 24px 20px;
    color: #6b7280;
    font-size: 14px;
    display: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    margin: 16px 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.no-more-data.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.no-more-data::before {
    content: '✨';
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.6;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.back-to-top:active {
    transform: translateY(-1px);
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 页面标题 */
.page h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 700;
}

/* 移动端样式直接应用 */
.header-content {
    padding: 0 15px;
}

.page {
    padding: 15px;
}

.hero-section {
    padding: 30px 15px;
}

.hero-section h2 {
    font-size: 24px;
}

.contact-form,
.feature-card {
    padding: 20px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}



/* 安全区域适配 */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .bottom-nav {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}