/* 移动端打卡按钮优化 */

/* 打卡项目容器优化 - 使用Grid布局 */
.checkin-item {
    padding: 16px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    grid-template-rows: auto auto auto;
    grid-template-areas: 
        "icon title streak"
        "icon details streak"
        "button button button";
    align-items: start;
    column-gap: 16px;
    row-gap: 8px;
    min-height: auto;
    position: relative;
}

/* 打卡项目头部信息 - 移除，使用Grid布局 */
.checkin-item .item-header {
    display: contents; /* 让子元素直接参与Grid布局 */
}

/* 打卡项目图标区域 */
.checkin-item .item-icon {
    grid-area: icon;
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 200, 150, 0.1);
    flex-shrink: 0;
    align-self: start;
}

/* 打卡项目信息区域 */
.checkin-item .item-info {
    display: contents; /* 让子元素直接参与Grid布局 */
}

.checkin-item .item-name {
    grid-area: title;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: center;
}

.checkin-item .item-description {
    grid-area: details;
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.2;
    margin: 0;
    align-self: start;
}

/* 打卡按钮优化 - 淡橙色主题 */
.checkin-item .btn {
    grid-area: button;
    background: linear-gradient(135deg, #FFC896 0%, #FFB366 100%);
    border: none;
    color: #8B4513;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 20px;
    border-radius: 12px;
    min-height: 44px;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 3px 10px rgba(255, 200, 150, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    justify-self: stretch;
}

.checkin-item .btn:hover {
    background: linear-gradient(135deg, #FFB366 0%, #FF9F40 100%);
    box-shadow: 0 5px 15px rgba(255, 200, 150, 0.4);
    transform: translateY(-2px);
}

.checkin-item .btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 200, 150, 0.3);
}

/* 已完成状态的按钮 */
.checkin-item.completed .btn {
    background: linear-gradient(135deg, #E8F5E8 0%, #D4F4D4 100%);
    color: #2D5A2D;
    box-shadow: 0 3px 10px rgba(45, 90, 45, 0.2);
}

.checkin-item.completed .btn:hover {
    background: linear-gradient(135deg, #D4F4D4 0%, #C1F0C1 100%);
    box-shadow: 0 5px 15px rgba(45, 90, 45, 0.3);
}

/* 连击徽章位置调整 */
.streak-badge {
    grid-area: streak;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
    z-index: 2;
    justify-self: end;
    align-self: start;
    white-space: nowrap;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    .checkin-item {
        padding: 14px;
        margin-bottom: 10px;
        grid-template-columns: 52px 1fr auto;
        column-gap: 14px;
        row-gap: 6px;
    }
    
    .checkin-item .item-icon {
        width: 52px;
        height: 52px;
        font-size: 1.8rem;
        border-radius: 14px;
    }
    
    .checkin-item .btn {
        font-size: 0.9rem;
        padding: 10px 16px;
        min-height: 42px;
        margin-top: 6px;
    }
    
    .checkin-item .item-name {
        font-size: 1rem;
    }
    
    .checkin-item .item-description {
        font-size: 0.85rem;
    }
    
    .streak-badge {
        padding: 3px 6px;
        font-size: 0.7rem;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .checkin-item {
        padding: 12px;
        margin-bottom: 8px;
        grid-template-columns: 48px 1fr auto;
        column-gap: 12px;
        row-gap: 4px;
    }
    
    .checkin-item .item-icon {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
        border-radius: 12px;
    }
    
    .checkin-item .btn {
        font-size: 0.85rem;
        padding: 9px 14px;
        min-height: 40px;
        border-radius: 10px;
        margin-top: 4px;
    }
    
    .checkin-item .item-name {
        font-size: 0.95rem;
    }
    
    .checkin-item .item-description {
        font-size: 0.8rem;
    }
    
    .streak-badge {
        padding: 2px 5px;
        font-size: 0.65rem;
        border-radius: 8px;
    }
}

/* 按钮波纹效果 */
.checkin-item .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.checkin-item .btn:active::before {
    width: 100%;
    height: 100%;
}

/* 确保文字不被遮挡 - Grid布局下的优化 */
.checkin-item .item-name {
    min-width: 0; /* 允许文字收缩 */
}

.checkin-item .item-description {
    min-width: 0; /* 允许文字收缩 */
}

/* 小屏幕下允许文字换行 */
@media (max-width: 480px) {
    .checkin-item .item-name {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.2;
    }
    
    .checkin-item .item-description {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}