/* 移动端布局优化样式 */

/* 全局容器优化 */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
        max-width: 100%;
    }
    
    /* 页面间距优化 */
    .main-content {
        padding-top: 8px;
        padding-bottom: 80px; /* 为底部导航留出空间 */
    }
    
    /* 页面标题优化 */
    .page-header {
        margin-bottom: 16px;
        padding: 12px 0;
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
        font-weight: 700;
        color: #2c3e50;
        margin: 0;
        line-height: 1.3;
    }
    
    /* 网格布局优化 */
    .checkin-grid, 
    .shop-grid, 
    .achievements-grid, 
    .deduction-grid,
    .evaluation-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
    }
    
    /* 卡片布局统一优化 */
    .item-card, 
    .checkin-item, 
    .shop-item, 
    .achievement-item, 
    .deduction-item,
    .evaluation-card {
        background: #ffffff;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        border: 1px solid #f0f0f0;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        position: relative;
        overflow: hidden;
    }
    
    /* 卡片内容布局 */
    .item-card {
        display: grid;
        grid-template-columns: 56px 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas: 
            "icon title action"
            "icon details action";
        align-items: center;
        column-gap: 16px;
        row-gap: 4px;
        min-height: 72px;
    }
    
    /* 图标区域 */
    .item-icon,
    .checkin-icon,
    .shop-icon,
    .achievement-icon,
    .deduction-icon {
        grid-area: icon;
        font-size: 2rem;
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 16px;
        border: 2px solid #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* 标题区域 */
    .item-name,
    .checkin-name,
    .shop-name,
    .achievement-name,
    .deduction-name {
        grid-area: title;
        font-size: 1.1rem;
        font-weight: 600;
        color: #2c3e50;
        margin: 0;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 详情区域 */
    .item-details,
    .checkin-details,
    .shop-details,
    .achievement-details,
    .deduction-details {
        grid-area: details;
        display: flex;
        gap: 8px;
        align-items: center;
        font-size: 0.85rem;
        color: #6c757d;
        margin: 0;
        flex-wrap: wrap;
    }
    
    /* 操作按钮区域 */
    .item-action,
    .checkin-action,
    .shop-action,
    .buy-btn {
        grid-area: action;
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 商城特殊布局优化 */
    .shop-item {
        display: grid;
        grid-template-columns: 56px 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas: 
            "icon title button"
            "icon details button";
        align-items: center;
        column-gap: 16px;
        row-gap: 4px;
        padding: 16px;
    }
    
    .shop-info-wrapper {
        display: contents;
    }
    
    .shop-info {
        display: contents;
    }
    
    .shop-price {
        background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
        color: white;
        padding: 4px 8px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 0.8rem;
        margin: 0;
        box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
    }
    
    .shop-stock {
        background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
        color: white;
        padding: 4px 8px;
        border-radius: 8px;
        font-size: 0.8rem;
        margin: 0;
        box-shadow: 0 2px 4px rgba(116, 185, 255, 0.3);
    }
    
    /* 评价系统布局优化 */
    .evaluation-card {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .evaluation-header {
        display: flex;
        align-items: center;
        margin-bottom: 16px;
        gap: 12px;
    }
    
    .evaluation-icon {
        font-size: 2rem;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 12px;
        flex-shrink: 0;
    }
    
    .evaluation-info {
        flex: 1;
        min-width: 0;
    }
    
    .evaluation-name {
        font-size: 1.2rem;
        font-weight: 600;
        color: #2c3e50;
        margin: 0 0 4px 0;
        line-height: 1.3;
    }
    
    .evaluation-description {
        color: #6c757d;
        font-size: 0.9rem;
        margin: 0;
        line-height: 1.4;
    }
    
    /* 导航栏优化 */
    .main-navigation {
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 8px 0;
        background: #ffffff;
        border-top: 1px solid #f0f0f0;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    }
    
    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px 12px;
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        background: transparent;
        border: none;
        cursor: pointer;
        min-width: 60px;
    }
    
    .nav-item.active {
        background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
        color: #1976d2;
    }
    
    .nav-icon {
        font-size: 1.5rem;
        margin-bottom: 4px;
        transition: transform 0.3s ease;
    }
    
    .nav-item.active .nav-icon {
        transform: scale(1.1);
    }
    
    .nav-label {
        font-size: 0.75rem;
        font-weight: 500;
        line-height: 1;
    }
    
    /* 顶部头部优化 */
    .top-header {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        border-bottom: 1px solid #f0f0f0;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    /* 底部导航固定 */
    .bottom-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #f0f0f0;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        z-index: 100;
        padding: 8px 0;
    }
    
    /* 内容区域适配底部导航 */
    body {
        padding-bottom: 80px;
    }
    
    /* 页面切换动画优化 */
    .page {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        pointer-events: none;
    }
    
    .page.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    /* 加载状态优化 */
    .loading {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        color: #6c757d;
        font-size: 0.9rem;
    }
    
    .loading::before {
        content: '';
        width: 20px;
        height: 20px;
        border: 2px solid #e9ecef;
        border-top: 2px solid #007bff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-right: 12px;
    }
    
    /* 空状态优化 */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: #6c757d;
    }
    
    .empty-state-icon {
        font-size: 3rem;
        margin-bottom: 16px;
        opacity: 0.5;
    }
    
    .empty-state-text {
        font-size: 1rem;
        line-height: 1.5;
        margin: 0;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .item-card {
        padding: 12px;
        grid-template-columns: 48px 1fr auto;
        column-gap: 12px;
    }
    
    .item-icon,
    .checkin-icon,
    .shop-icon,
    .achievement-icon,
    .deduction-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        border-radius: 12px;
    }
    
    .item-name,
    .checkin-name,
    .shop-name,
    .achievement-name,
    .deduction-name {
        font-size: 1rem;
    }
    
    .item-details,
    .checkin-details,
    .shop-details,
    .achievement-details,
    .deduction-details {
        font-size: 0.8rem;
    }
    
    .evaluation-card {
        padding: 16px;
    }
    
    .evaluation-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .evaluation-name {
        font-size: 1.1rem;
    }
    
    .nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .nav-icon {
        font-size: 1.3rem;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding-bottom: 60px;
    }
    
    .bottom-footer {
        padding: 4px 0;
    }
    
    .nav-item {
        padding: 4px 8px;
    }
    
    .nav-icon {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
    
    body {
        padding-bottom: 60px;
    }
}