/* 全局样式 - 移动端 uni-app 风格 */

/* 引入 Google Fonts - Inter 字体（海外最流行） */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* 海外主流配色方案 */
    --primary-color: #4F46E5;     /* Indigo - 海外科技产品常用 */
    --primary-dark: #4338CA;      /* Dark Indigo */
    --primary-light: #818CF8;     /* Light Indigo */
    --secondary-color: #7C3AED;   /* Purple - 现代感 */
    --accent-color: #EC4899;      /* Pink - 强调色 */
    --success-color: #10B981;     /* Emerald Green */
    --warning-color: #F59E0B;     /* Amber */
    --danger-color: #EF4444;      /* Bright Red */
    --info-color: #3B82F6;        /* Blue */
    
    /* 中性色（更柔和） */
    --text-primary: #111827;      /* Gray 900 */
    --text-secondary: #6B7280;    /* Gray 500 */
    --text-light: #9CA3AF;        /* Gray 400 */
    --bg-page: #F9FAFB;           /* Gray 50 */
    --bg-white: #FFFFFF;
    --border-color: #E5E7EB;      /* Gray 200 */
    --border-light: #F3F4F6;      /* Gray 100 */
    
    /* 阴影（更柔和分散） */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 间距系统（使用 rem 更灵活） */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 0.75rem;   /* 12px */
    --spacing-lg: 1rem;      /* 16px */
    --spacing-xl: 1.25rem;   /* 20px */
    --spacing-xxl: 1.5rem;   /* 24px */
    --spacing-3xl: 2rem;     /* 32px */
    
    /* 圆角系统（更大更现代） */
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;   /* 圆形 */
    
    /* 国际化字体栈 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
    
    /* 字体大小（使用 rem） */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    
    /* 行高 */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased; /* Mac 字体平滑 */
    -moz-osx-font-smoothing: grayscale;  /* Firefox 字体平滑 */
    padding-bottom: env(safe-area-inset-bottom);
    letter-spacing: -0.01em; /* 轻微字间距，更符合西文阅读 */
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    padding-bottom: 50px;
}

/* 顶部导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.navbar-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
}

.navbar-left {
    width: 80px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border-radius: 20px;
    padding: 6px 12px;
    flex: 1;
    max-width: 300px;
}

.search-bar i {
    color: var(--text-light);
    font-size: 14px;
    margin-right: 8px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.navbar-right {
    width: 80px;
    display: flex;
    justify-content: flex-end;
}

.nav-icon {
    color: var(--text-primary);
    font-size: 20px;
    text-decoration: none;
}

/* 底部标签栏 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 10px;
    gap: 2px;
}

.tabbar-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

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

/* 通用区块样式 */
section {
    background: var(--bg-white);
    margin-bottom: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 12px 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

.section-title i {
    color: var(--primary-color);
}

.section-more {
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 轮播图 */
.banner-section {
    margin-top: 44px;
    background: transparent;
}

.swiper-container {
    position: relative;
    height: 150px;
    overflow: hidden;
}

.swiper-wrapper {
    display: flex;
    height: 100%;
}

.swiper-slide {
    min-width: 100%;
    height: 100%;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.swiper-pagination-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.swiper-pagination-dot.active {
    width: 16px;
    border-radius: 3px;
    background: var(--primary-color);
}

/* 金刚区 */
.icon-nav-section {
    background: var(--bg-white);
}

.icon-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px 10px;
    padding: 15px 12px;
}

.icon-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.icon-nav-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-white);
    font-size: 20px;
}

.icon-nav-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 商品卡片 */
.goods-section {
    background: var(--bg-white);
}

.goods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 12px 12px;
}

.goods-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.goods-image {
    position: relative;
    width: 100%;
    height: 170px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.goods-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.goods-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--bg-white);
    font-weight: 600;
}

.goods-tag.hot {
    background: linear-gradient(135deg, #ff6b6b, #f5222d);
}

.goods-tag.new {
    background: linear-gradient(135deg, #52c41a, #389e0d);
}

.goods-info {
    padding: 10px;
}

.goods-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.goods-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.goods-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.goods-price {
    font-size: 16px;
    font-weight: bold;
    color: var(--danger-color);
}

.btn-buy {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-white);
    border: none;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
}

/* 横向滚动商品 */
.goods-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 12px 12px;
    -webkit-overflow-scrolling: touch;
}

.goods-scroll::-webkit-scrollbar {
    display: none;
}

.goods-item {
    min-width: 140px;
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.goods-item .goods-image {
    height: 140px;
}

.goods-item .goods-info {
    padding: 8px;
    text-align: center;
}

.goods-item .goods-name {
    font-size: 13px;
    margin-bottom: 4px;
}

.goods-item .goods-price {
    font-size: 14px;
}

/* 公告列表 */
.notice-section {
    background: var(--bg-white);
}

.notice-list {
    padding: 0 12px 12px;
}

.notice-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.notice-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--bg-white);
    background: var(--primary-color);
    flex-shrink: 0;
}

.notice-tag.activity {
    background: var(--success-color);
}

.notice-tag.new {
    background: var(--warning-color);
}

.notice-title {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-date {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* 工具类 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* ========================================
   UI 对齐优化 - 统一视觉规范
   ======================================== */

/* ========================================
   海外版 UI 优化（International Version）
   ======================================== */

/* 1. 更大的按钮尺寸（海外用户偏好） */
.btn-buy-box,
.btn-buy-goods,
.btn-primary {
    padding: 0.75rem 1.5rem; /* 12px × 24px */
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.025em; /* 西文字间距 */
    text-transform: uppercase; /* 英文大写更显专业 */
}

/* 2. 更现代的渐变（柔和不刺眼） */
.btn-buy-box {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
}

.btn-buy-box:hover {
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

/* 3. 更清晰的文字层级 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.box-name,
.goods-name {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: var(--leading-tight);
}

/* 4. 更宽敞的卡片布局 */
.blindbox-card,
.goods-card,
.creator-card {
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
}

/* 5. 更现代的标签设计 */
.box-tag,
.goods-tag,
.badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

/* 6. 更清晰的价格显示 */
.box-price,
.goods-price {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--danger-color);
    font-family: var(--font-mono); /* 等宽字体显示数字更清晰 */
    letter-spacing: -0.025em;
}

/* 7. 更柔和的阴影层次 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 8. 更现代的输入框样式 */
input,
textarea,
select {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 9. 更清晰的分割线 */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-xxl) 0;
}

/* 10. 更现代的加载动画 */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 11. 更友好的空状态 */
.empty-state {
    padding: var(--spacing-3xl) var(--spacing-lg);
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: var(--bg-page);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-light);
}

/* 12. 更专业的提示框 */
.toast {
    background: var(--text-primary);
    color: var(--bg-white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    letter-spacing: 0.025em;
}

/* 13. 响应式优化（海外大屏手机更多） */
@media (min-width: 768px) {
    :root {
        --spacing-lg: 1.25rem;
        --spacing-xl: 1.5rem;
    }
    
    .goods-grid,
    .creator-grid {
        grid-template-columns: repeat(3, 1fr); /* 平板显示 3 列 */
    }
}

/* 14. 暗黑模式支持（准备） */
@media (prefers-color-scheme: dark) {
    :root {
        /* 暗黑模式配色（可选） */
        /* --bg-page: #111827; */
        /* --bg-white: #1F2937; */
        /* --text-primary: #F9FAFB; */
    }
}

/* 15. 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 16. 打印样式优化 */
@media print {
    body {
        background: white;
    }
    
    .tabbar,
    .navbar,
    .btn-buy-box {
        display: none !important;
    }
}

/* 1. 统一的卡片内边距 */
.blindbox-card,
.goods-card,
.creator-card,
.album-card,
.menu-item {
    padding: var(--spacing-lg);
}

/* 2. 统一的标题对齐 */
.box-name,
.goods-name,
.creator-name,
.album-name {
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

/* 3. 统一的描述文字对齐 */
.box-desc,
.goods-desc,
.creator-desc,
.album-desc {
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

/* 4. 统一的底部对齐 */
.box-footer,
.goods-footer,
.creator-footer,
.album-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 5. 统一的图标尺寸 */
.icon-nav-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    font-size: 22px;
}

/* 6. 统一的标签样式 */
.box-tag,
.goods-tag,
.album-tag {
    padding: 4px 10px;
    border-radius: var(--radius-round);
    font-size: 11px;
    font-weight: 600;
}

/* 7. 统一的价格显示 */
.box-price,
.goods-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--danger-color);
    line-height: 1.2;
}

/* 8. 统一的按钮尺寸 */
.btn-buy-box,
.btn-buy-goods {
    padding: 8px 20px;
    border-radius: var(--radius-round);
    font-size: 14px;
    font-weight: 600;
    min-width: 100px;
}

/* 9. 统一的图片比例 */
.box-image,
.goods-image,
.album-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

/* 10. 统一的阴影效果 */
.blindbox-card,
.goods-card,
.creator-card {
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.blindbox-card:hover,
.goods-card:hover,
.creator-card:hover {
    box-shadow: var(--shadow-md);
}

/* 11. 统一的网格间距 */
.goods-grid,
.creator-grid,
.album-grid {
    gap: var(--spacing-lg);
}

/* 12. 统一的 Section 内边距 */
.section-header {
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
}

/* 13. 统一的文字层级 */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-light {
    color: var(--text-light);
}

/* 14. 统一的 Flex 布局 */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 15. 统一的响应式间距 */
@media (max-width: 375px) {
    :root {
        --spacing-lg: 12px;
        --spacing-xl: 16px;
    }
    
    .goods-grid,
    .creator-grid,
    .album-grid {
        gap: var(--spacing-md);
    }
}

/* 16. 统一的加载状态 */
.loading-skeleton {
    background: linear-gradient(90deg, 
        var(--bg-page) 25%, 
        var(--border-color) 50%, 
        var(--bg-page) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

/* 17. 统一的空状态 */
.empty-state {
    padding: var(--spacing-xxl) var(--spacing-lg);
    text-align: center;
    color: var(--text-light);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: var(--spacing-lg);
}

/* 18. 统一的分隔线 */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-lg) 0;
}

/* 19. 统一的徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: var(--radius-round);
    font-size: 11px;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-color);
    color: var(--bg-white);
}

.badge-success {
    background: var(--success-color);
    color: var(--bg-white);
}

.badge-warning {
    background: var(--warning-color);
    color: var(--bg-white);
}

/* 20. 统一的动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

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

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